From 2c44d754c0f7693e414bf57148772b4bc8cc023b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 31 Mar 2015 21:56:22 +0200 Subject: Showswitch: Show IP --- web/nms.gathering.org/showswitch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/nms.gathering.org/showswitch.pl b/web/nms.gathering.org/showswitch.pl index b184bc5..21db6ac 100755 --- a/web/nms.gathering.org/showswitch.pl +++ b/web/nms.gathering.org/showswitch.pl @@ -25,7 +25,7 @@ my $start = [Time::HiRes::gettimeofday]; my $dbh = nms::db_connect(); # Fetch the name -my $ref = $dbh->selectrow_hashref('SELECT sysname FROM switches WHERE switch=?', undef, $switch); +my $ref = $dbh->selectrow_hashref('SELECT sysname,ip FROM switches WHERE switch=?', undef, $switch); print $cgi->header(-type=>'text/html; charset=utf-8'); print <<"EOF"; @@ -34,7 +34,7 @@ print <<"EOF"; snmp -

Switch $switch ($ref->{'sysname'})

+

Switch $switch ($ref->{'sysname'} - $ref->{'ip'})

EOF my $q = $dbh->prepare('select port,coalesce(description, \'Port \' || port) as description,extract(epoch from time) as time,bytes_in,bytes_out from switches natural left join portnames natural join polls where time between now() - \'1 day\'::interval and now() and switch=? order by switch,port,time;') or die $dbh->errstr; -- cgit v1.2.3