add example snmpd.conf :)

git-svn-id: http://www.observium.org/svn/observer/trunk@537 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong 2009-11-30 16:06:30 +00:00
parent 6d0a574172
commit 5dcf9d6854
5 changed files with 76 additions and 35 deletions

View File

@ -13,12 +13,13 @@
if ($device['features']) { $device['features'] = "(".$device['features'].")"; } if ($device['features']) { $device['features'] = "(".$device['features'].")"; }
$device['os_text'] = $os_text[$device[os]];
echo("$ddev_img echo("$ddev_img
<table width=100%> <table width=100%>
<tr> <tr>
<td class=list-bold>Operating System</td> <td class=list-bold>Operating System</td>
<td>" . $device['os'] . " " . $device['version'] . " " . $device['features'] . " </td> <td>" . $device['os_text'] . " " . $device['version'] . " " . $device['features'] . " </td>
</tr>"); </tr>");
if($device['hardware']) {echo("<tr> if($device['hardware']) {echo("<tr>

View File

@ -6,62 +6,85 @@
$rrd_filename_6 = $config['rrd_dir'] . "/" . $hostname . "/ipSystemStats-ipv6.rrd"; $rrd_filename_6 = $config['rrd_dir'] . "/" . $hostname . "/ipSystemStats-ipv6.rrd";
$rrd_options .= " DEF:InForwDatagrams_4=$rrd_filename_4:InForwDatagrams:AVERAGE"; $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:InDelivers_4=$rrd_filename_4:InDelivers:AVERAGE";
$rrd_options .= " DEF:InReceives_4=$rrd_filename_4:InReceives: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: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 .= " 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 .= " 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: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:InDelivers_6=$rrd_filename_6:InDelivers:AVERAGE";
$rrd_options .= " DEF:InReceives_6=$rrd_filename_6:InReceives: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: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 .= " 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 .= " 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 .= " 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 .= " AREA:InReceives_4#003300:'InReceives v4'";
$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 .= " GPRINT:InReceives_4:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:InReceives_4:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:InReceives_4:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:InReceives_4:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:InReceives_4:MAX:%6.2lf%s\\\\n"; $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:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:InReceives_6:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:InReceives_6:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:InReceives_6:MAX:%6.2lf%s\\\\n"; $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:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:OutRequests_4:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:OutRequests_4:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:OutRequests_4:MAX:%6.2lf%s\\\\n"; $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:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:OutRequests_6:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:OutRequests_6:AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:OutRequests_6:MAX:%6.2lf%s\\\\n"; $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";
?> ?>

View File

@ -1,5 +1,11 @@
<?php <?php
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv6.rrd")) {
echo("<div class=graphhead>IPv4/IPv6 Statistics</div>");
$graph_type = "device_ipSystemStats"; include ("includes/print-device-graph.php");
echo("<br />");
}
echo("<div class=graphhead>IP Statistics</div>"); echo("<div class=graphhead>IP Statistics</div>");
$graph_type = "device_ip"; include ("includes/print-device-graph.php"); $graph_type = "device_ip"; include ("includes/print-device-graph.php");
echo("<br />"); echo("<br />");

View File

@ -16,13 +16,13 @@
list($descr, $units, $size, $fstype) = explode("\n", $temp); list($descr, $units, $size, $fstype) = explode("\n", $temp);
list($units) = explode(" ", $units); list($units) = explode(" ", $units);
$allow = 1; $allow = 1;
foreach($config['ignore_mount'] as $bi) { foreach($config['ignore_mount'] as $bi) { if($bi == $descr) { $allow = 0; } }
if($descr == $bi) { foreach($config['ignore_mount_string'] as $bi) { if(strpos($descr, $bi) !== FALSE) { $allow = 0; } else { echo("$descr -> $bi \n"); } }
$allow = 0; 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') { 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 = "INSERT INTO storage (`host_id`, `hrStorageIndex`, `hrStorageType`, `hrStorageDescr`,`hrStorageSize`,`hrStorageAllocationUnits`) ";
$query .= "values ('".$device['device_id']."', '$hrStorageIndex', '$fstype', '$descr', '$size', '$units')"; $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']."'"; $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); $query = mysql_query($sql);

12
snmpd.conf.example Normal file
View File

@ -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 <your@email.address>
#Distro Detection
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro