From 501f68880c8d8c5a65dc24aa8061dda84e46f961 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Tue, 28 Apr 2009 11:23:38 +0000 Subject: [PATCH] add more files git-svn-id: http://www.observium.org/svn/observer/trunk@411 61d68cd4-352d-0410-923a-c4978735b2b8 --- addhost.php | 5 +++-- html/pages/device/collectd.inc.php | 7 +++++++ html/pages/device/graphs/os-ios.inc.php | 18 ++++++++++++++++++ html/pages/device/graphs/os-ios_xe.inc.php | 5 +++++ html/pages/device/graphs/os-linux.inc.php | 5 +++++ html/pages/device/graphs/os-unix.inc.php | 5 +++++ 6 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 html/pages/device/collectd.inc.php create mode 100644 html/pages/device/graphs/os-ios.inc.php create mode 100644 html/pages/device/graphs/os-ios_xe.inc.php create mode 100644 html/pages/device/graphs/os-linux.inc.php create mode 100644 html/pages/device/graphs/os-unix.inc.php diff --git a/addhost.php b/addhost.php index 1b0127882b..a9e827ec58 100755 --- a/addhost.php +++ b/addhost.php @@ -15,9 +15,10 @@ if($argv[1] && $argv[2] && $argv[3]) { list($hostshort) = explode(".", $host); if ( isDomainResolves($argv[1])){ - if ( isPingable($argv[1])) { + if ( isPingable($argv[1])) { if ( mysql_result(mysql_query("SELECT COUNT(*) FROM `devices` WHERE `hostname` = '".mres($host)."'"), 0) == '0' ) { - $snmphost = trim(shell_exec($config['snmpget'] ." -m SNMPv2-MIB -Oqv -$snmpver -c $community $host:$port sysName.0 | sed s/\"//g")); + echo($config['snmpget'] ." -m SNMPv2-MIB -Oqv -$snmpver -c $community $host:$port sysName.0"); + $snmphost = trim(str_replace("\"", "", shell_exec($config['snmpget'] ." -m SNMPv2-MIB -Oqv -$snmpver -c $community $host:$port sysName.0"))); # var_dump($snmphost); if ($snmphost == $host || $hostshort = $host) { $return = createHost ($host, $community, $snmpver, $port); diff --git a/html/pages/device/collectd.inc.php b/html/pages/device/collectd.inc.php new file mode 100644 index 0000000000..7f7b703cab --- /dev/null +++ b/html/pages/device/collectd.inc.php @@ -0,0 +1,7 @@ + + diff --git a/html/pages/device/graphs/os-ios.inc.php b/html/pages/device/graphs/os-ios.inc.php new file mode 100644 index 0000000000..dfd7059257 --- /dev/null +++ b/html/pages/device/graphs/os-ios.inc.php @@ -0,0 +1,18 @@ +CPU Usage"); +$graph_type = "cpu"; include ("includes/print-device-graph.php"); +echo("
"); +echo("
Memory Usage
"); +$graph_type = "mem"; include ("includes/print-device-graph.php"); +echo("
"); +if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) { + echo("
Temperatures
"); + $graph_type = "dev_temp"; include ("includes/print-device-graph.php"); + echo("
"); +} + +include("netstats.inc.php"); +include("uptime.inc.php"); + +?> diff --git a/html/pages/device/graphs/os-ios_xe.inc.php b/html/pages/device/graphs/os-ios_xe.inc.php new file mode 100644 index 0000000000..2354f8d7d4 --- /dev/null +++ b/html/pages/device/graphs/os-ios_xe.inc.php @@ -0,0 +1,5 @@ + diff --git a/html/pages/device/graphs/os-linux.inc.php b/html/pages/device/graphs/os-linux.inc.php new file mode 100644 index 0000000000..d447d8e98b --- /dev/null +++ b/html/pages/device/graphs/os-linux.inc.php @@ -0,0 +1,5 @@ + diff --git a/html/pages/device/graphs/os-unix.inc.php b/html/pages/device/graphs/os-unix.inc.php new file mode 100644 index 0000000000..2fb76b0344 --- /dev/null +++ b/html/pages/device/graphs/os-unix.inc.php @@ -0,0 +1,5 @@ +