From 5dcf9d68540d1b7c943570eec3465dbe90da25bf Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 30 Nov 2009 16:06:30 +0000 Subject: [PATCH] add example snmpd.conf :) git-svn-id: http://www.observium.org/svn/observer/trunk@537 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/dev-overview-data.inc.php | 3 +- .../graphs/device_ipSystemStats.inc.php | 77 ++++++++++++------- html/pages/device/graphs/netstats.inc.php | 6 ++ includes/discovery/storage.php | 13 ++-- snmpd.conf.example | 12 +++ 5 files changed, 76 insertions(+), 35 deletions(-) create mode 100644 snmpd.conf.example diff --git a/html/includes/dev-overview-data.inc.php b/html/includes/dev-overview-data.inc.php index b4586476ea..ac31743b44 100644 --- a/html/includes/dev-overview-data.inc.php +++ b/html/includes/dev-overview-data.inc.php @@ -13,12 +13,13 @@ if ($device['features']) { $device['features'] = "(".$device['features'].")"; } + $device['os_text'] = $os_text[$device[os]]; echo("$ddev_img - + "); if($device['hardware']) {echo(" diff --git a/html/includes/graphs/device_ipSystemStats.inc.php b/html/includes/graphs/device_ipSystemStats.inc.php index fab9591fd5..2d8c444ab2 100644 --- a/html/includes/graphs/device_ipSystemStats.inc.php +++ b/html/includes/graphs/device_ipSystemStats.inc.php @@ -6,62 +6,85 @@ $rrd_filename_6 = $config['rrd_dir'] . "/" . $hostname . "/ipSystemStats-ipv6.rrd"; $rrd_options .= " DEF:InForwDatagrams_4=$rrd_filename_4:InForwDatagrams:AVERAGE"; - $rrd_options .= " DEF:OutForwDatagrams_4=$rrd_filename_4:OutForwDatagrams:AVERAGE"; $rrd_options .= " DEF:InDelivers_4=$rrd_filename_4:InDelivers:AVERAGE"; $rrd_options .= " DEF:InReceives_4=$rrd_filename_4:InReceives:AVERAGE"; - $rrd_options .= " DEF:OutRequests_4=$rrd_filename_4:OutRequests:AVERAGE"; $rrd_options .= " DEF:InDiscards_4=$rrd_filename_4:InDiscards:AVERAGE"; + + $rrd_options .= " DEF:OutForwDatagrams_4=$rrd_filename_4:OutForwDatagrams:AVERAGE"; + $rrd_options .= " CDEF:OutForwDatagrams_4_n=OutForwDatagrams_4,-1,*"; + $rrd_options .= " DEF:OutRequests_4=$rrd_filename_4:OutRequests:AVERAGE"; + $rrd_options .= " CDEF:OutRequests_4_n=OutRequests_4,-1,*"; $rrd_options .= " DEF:OutDiscards_4=$rrd_filename_4:OutDiscards:AVERAGE"; + $rrd_options .= " CDEF:OutDiscards_4_n=OutDiscards_4,-1,*"; $rrd_options .= " DEF:OutNoRoutes_4=$rrd_filename_4:InDiscards:AVERAGE"; + $rrd_options .= " CDEF:OutNoRoutes_4_n=OutNoRoutes_4,-1,*"; + $rrd_options .= " DEF:InForwDatagrams_6=$rrd_filename_6:InForwDatagrams:AVERAGE"; - $rrd_options .= " DEF:OutForwDatagrams_6=$rrd_filename_6:OutForwDatagrams:AVERAGE"; $rrd_options .= " DEF:InDelivers_6=$rrd_filename_6:InDelivers:AVERAGE"; $rrd_options .= " DEF:InReceives_6=$rrd_filename_6:InReceives:AVERAGE"; - $rrd_options .= " DEF:OutRequests_6=$rrd_filename_6:OutRequests:AVERAGE"; $rrd_options .= " DEF:InDiscards_6=$rrd_filename_6:InDiscards:AVERAGE"; + + $rrd_options .= " DEF:OutForwDatagrams_6=$rrd_filename_6:OutForwDatagrams:AVERAGE"; + $rrd_options .= " CDEF:OutForwDatagrams_6_n=OutForwDatagrams_6,-1,*"; + $rrd_options .= " DEF:OutRequests_6=$rrd_filename_6:OutRequests:AVERAGE"; + $rrd_options .= " CDEF:OutRequests_6_n=OutRequests_6,-1,*"; $rrd_options .= " DEF:OutDiscards_6=$rrd_filename_6:OutDiscards:AVERAGE"; + $rrd_options .= " CDEF:OutDiscards_6_n=OutDiscards_6,-1,*"; $rrd_options .= " DEF:OutNoRoutes_6=$rrd_filename_6:InDiscards:AVERAGE"; + $rrd_options .= " CDEF:OutNoRoutes_6_n=OutNoRoutes_6,-1,*"; + $rrd_options .= " COMMENT:'Packets/sec Current Average Maximum\\n'"; - $rrd_options .= " LINE1.25:InForwDatagrams_4#cc0000:InForwDgrams.4"; - $rrd_options .= " GPRINT:InForwDatagrams_4:LAST:%6.2lf%s"; - $rrd_options .= " GPRINT:InForwDatagrams_4:AVERAGE:%6.2lf%s"; - $rrd_options .= " GPRINT:InForwDatagrams_4:MAX:%6.2lf%s\\\\n"; - $rrd_options .= " LINE1.25:InForwDatagrams_6#cc0000:' .6'"; - $rrd_options .= " GPRINT:InForwDatagrams_6:LAST:%6.2lf%s"; - $rrd_options .= " GPRINT:InForwDatagrams_6:AVERAGE:%6.2lf%s"; - $rrd_options .= " GPRINT:InForwDatagrams_6:MAX:%6.2lf%s\\\\n"; - - $rrd_options .= " LINE1.25:InDelivers_4#00cc00:'InDelivers .4'"; - $rrd_options .= " GPRINT:InDelivers_4:LAST:%6.2lf%s"; - $rrd_options .= " GPRINT:InDelivers_4:AVERAGE:%6.2lf%s"; - $rrd_options .= " GPRINT:InDelivers_4:MAX:%6.2lf%s\\\\n"; - - $rrd_options .= " LINE1.25:InDelivers_6#00cc00:' .6'"; - $rrd_options .= " GPRINT:InDelivers_6:LAST:%6.2lf%s"; - $rrd_options .= " GPRINT:InDelivers_6:AVERAGE:%6.2lf%s"; - $rrd_options .= " GPRINT:InDelivers_6:MAX:%6.2lf%s\\\\n"; - - $rrd_options .= " LINE1.25:InReceives_4#006600:'InReceives .4'"; + $rrd_options .= " AREA:InReceives_4#003300:'InReceives v4'"; $rrd_options .= " GPRINT:InReceives_4:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:InReceives_4:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:InReceives_4:MAX:%6.2lf%s\\\\n"; - $rrd_options .= " LINE1.25:InReceives_6#006600:' .6'"; + $rrd_options .= " AREA:InReceives_6#91B13C:' v6':STACK"; $rrd_options .= " GPRINT:InReceives_6:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:InReceives_6:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:InReceives_6:MAX:%6.2lf%s\\\\n"; - $rrd_options .= " LINE1.25:OutRequests_4#0000cc:'OutRequests .4'"; + $rrd_options .= " AREA:OutRequests_4_n#000033:'OutRequests v4'"; $rrd_options .= " GPRINT:OutRequests_4:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:OutRequests_4:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:OutRequests_4:MAX:%6.2lf%s\\\\n"; - $rrd_options .= " LINE1.25:OutRequests_6#0000cc:' .6'"; + $rrd_options .= " AREA:OutRequests_6_n#8080BD:' v6':STACK"; $rrd_options .= " GPRINT:OutRequests_6:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:OutRequests_6:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:OutRequests_6:MAX:%6.2lf%s\\\\n"; + $rrd_options .= " LINE1.25:InForwDatagrams_4#AF63AF:'InForward v4'"; + $rrd_options .= " GPRINT:InForwDatagrams_4:LAST:%6.2lf%s"; + $rrd_options .= " GPRINT:InForwDatagrams_4:AVERAGE:%6.2lf%s"; + $rrd_options .= " GPRINT:InForwDatagrams_4:MAX:%6.2lf%s\\\\n"; + + $rrd_options .= " LINE1.25:InForwDatagrams_6#3F003F:' v6'"; + $rrd_options .= " GPRINT:InForwDatagrams_6:LAST:%6.2lf%s"; + $rrd_options .= " GPRINT:InForwDatagrams_6:AVERAGE:%6.2lf%s"; + $rrd_options .= " GPRINT:InForwDatagrams_6:MAX:%6.2lf%s\\\\n"; + + $rrd_options .= " LINE1.25:OutForwDatagrams_4#AF63AF:'OutForward v4'"; + $rrd_options .= " GPRINT:OutForwDatagrams_4:LAST:%6.2lf%s"; + $rrd_options .= " GPRINT:OutForwDatagrams_4:AVERAGE:%6.2lf%s"; + $rrd_options .= " GPRINT:OutForwDatagrams_4:MAX:%6.2lf%s\\\\n"; + + $rrd_options .= " LINE1.25:OutForwDatagrams_6#3F003F:' v6'"; + $rrd_options .= " GPRINT:OutForwDatagrams_6:LAST:%6.2lf%s"; + $rrd_options .= " GPRINT:OutForwDatagrams_6:AVERAGE:%6.2lf%s"; + $rrd_options .= " GPRINT:OutForwDatagrams_6:MAX:%6.2lf%s\\\\n"; + +# $rrd_options .= " LINE1.25:InDelivers_4#00cc00:'InDelivers v4'"; +# $rrd_options .= " GPRINT:InDelivers_4:LAST:%6.2lf%s"; +# $rrd_options .= " GPRINT:InDelivers_4:AVERAGE:%6.2lf%s"; +# $rrd_options .= " GPRINT:InDelivers_4:MAX:%6.2lf%s\\\\n"; + +# $rrd_options .= " LINE1.25:InDelivers_6#3F003F:' v6'"; +# $rrd_options .= " GPRINT:InDelivers_6:LAST:%6.2lf%s"; +# $rrd_options .= " GPRINT:InDelivers_6:AVERAGE:%6.2lf%s"; +# $rrd_options .= " GPRINT:InDelivers_6:MAX:%6.2lf%s\\\\n"; + ?> diff --git a/html/pages/device/graphs/netstats.inc.php b/html/pages/device/graphs/netstats.inc.php index 55379bd77c..a367e84283 100644 --- a/html/pages/device/graphs/netstats.inc.php +++ b/html/pages/device/graphs/netstats.inc.php @@ -1,5 +1,11 @@ IPv4/IPv6 Statistics"); + $graph_type = "device_ipSystemStats"; include ("includes/print-device-graph.php"); + echo("
"); + } + echo("
IP Statistics
"); $graph_type = "device_ip"; include ("includes/print-device-graph.php"); echo("
"); diff --git a/includes/discovery/storage.php b/includes/discovery/storage.php index cc4c892371..106c1c8ec8 100755 --- a/includes/discovery/storage.php +++ b/includes/discovery/storage.php @@ -16,13 +16,13 @@ list($descr, $units, $size, $fstype) = explode("\n", $temp); list($units) = explode(" ", $units); $allow = 1; - foreach($config['ignore_mount'] as $bi) { - if($descr == $bi) { - $allow = 0; - } - } + foreach($config['ignore_mount'] as $bi) { if($bi == $descr) { $allow = 0; } } + foreach($config['ignore_mount_string'] as $bi) { if(strpos($descr, $bi) !== FALSE) { $allow = 0; } else { echo("$descr -> $bi \n"); } } + foreach($config['ignore_mount_regexp'] as $bi) { if(preg_match($bi, $descr)) { $allow = 0; } } + $descr = str_replace("mounted on: ", "", $descr); + $descr = str_replace(": var file system", "", $descr); - if(strstr($fstype, "FixedDisk") || strstr($fstype, "Ram") || strstr($fstype, "VirtualMemory") && $size > '0' && $allow) { + if((strstr($fstype, "FixedDisk") || strstr($fstype, "Ram") || strstr($fstype, "VirtualMemory")) && $size > '0' && $allow) { if(mysql_result(mysql_query("SELECT count(storage_id) FROM `storage` WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'"),0) == '0') { $query = "INSERT INTO storage (`host_id`, `hrStorageIndex`, `hrStorageType`, `hrStorageDescr`,`hrStorageSize`,`hrStorageAllocationUnits`) "; $query .= "values ('".$device['device_id']."', '$hrStorageIndex', '$fstype', '$descr', '$size', '$units')"; @@ -42,7 +42,6 @@ } } - $sql = "SELECT * FROM storage AS S, devices AS D where S.host_id = D.device_id AND D.device_id = '".$device['device_id']."'"; $query = mysql_query($sql); diff --git a/snmpd.conf.example b/snmpd.conf.example new file mode 100644 index 0000000000..b347842aa4 --- /dev/null +++ b/snmpd.conf.example @@ -0,0 +1,12 @@ +com2sec readonly default m3m3t1c + +group MyROGroup v2c readonly +view all included .1 80 +access MyROGroup "" any noauth exact all none none + +syslocation Rack, Room, Building, City, Country [GPSX,Y] +syscontact Your Name + +#Distro Detection +extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro +
Operating System" . $device['os'] . " " . $device['version'] . " " . $device['features'] . " " . $device['os_text'] . " " . $device['version'] . " " . $device['features'] . "