diff options
author | root <root@einstein.tg15.gathering.org> | 2015-03-31 21:56:22 +0200 |
---|---|---|
committer | root <root@einstein.tg15.gathering.org> | 2015-03-31 21:56:22 +0200 |
commit | 2c44d754c0f7693e414bf57148772b4bc8cc023b (patch) | |
tree | 96a040ce724ff8068493a4de5a9e76ba24228052 | |
parent | 21a8669ab88db1af24fe8e7bacfcb868ffd5188f (diff) |
Showswitch: Show IP
-rwxr-xr-x | web/nms.gathering.org/showswitch.pl | 4 |
1 files changed, 2 insertions, 2 deletions
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"; <title>snmp</title> </head> <body> - <h1>Switch $switch ($ref->{'sysname'})</h1> + <h1>Switch $switch ($ref->{'sysname'} - $ref->{'ip'})</h1> 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; |