Hi All,
Thanks for this wonderfull product! I'm realy impressed.
While working with observium I've made some improvements, see patches below.
I hope it's the right format and the right way to send patches, as
this is advanced svn for me :)
root@eos:/opt# svn diff observium/
Index: observium/includes/services/dns/check.inc
===================================================================
--- observium/includes/services/dns/check.inc (revision 1784)
+++ observium/includes/services/dns/check.inc (working copy)
@@ -1,7 +1,10 @@
<?php
-$check = shell_exec($config['nagios_plugins'] . "/check_dns -H
".$service['param']." -s ".$service['hostname']);
+// provide some sane default
+if ($service['service_param']) { $nsquery =
$service['service_param']; } else { $nsquery = "localhost"; }
+$check = shell_exec($config['nagios_plugins'] . "/check_dns -H
".$nsquery." -s ".$service['hostname']);
+
list($check, $time) = split("\|", $check);
if(strstr($check, "DNS OK: ")) {
Index: observium/includes/services/mysql/check.inc
===================================================================
--- observium/includes/services/mysql/check.inc (revision 1784)
+++ observium/includes/services/mysql/check.inc (working copy)
@@ -1,7 +1,10 @@
<?php
-$check = shell_exec($config['nagios_plugins'] . "/check_mysql -H
".$service['hostname']." ".$service['service_param']);
+// provide some sane default
+if ($service['service_param']) { $dbname = $service['service_param'];
} else { $dbname = "mysql"; }
+$check = shell_exec($config['nagios_plugins'] . "/check_mysql -H
".$service['hostname']." ".$dbname);
+
list($check, $time) = split("\|", $check);
if(strstr($check, "Uptime:")) {
Index: observium/scan-snmp.php
===================================================================
--- observium/scan-snmp.php (revision 1784)
+++ observium/scan-snmp.php (working copy)
@@ -10,7 +10,16 @@
$data = trim(`cat ips-scanned.txt | grep alive | cut -d" " -f 1 |
egrep $search`);
foreach( explode("\n", $data) as $ip) {
- $snmp = shell_exec("snmpget -t 0.2 -v2c -c ".$config['community']."
$ip sysName.0");
+ // find community to use
+ for ($i=0; $i<count($config['snmp']['community']); $i++) {
+ echo($ip." ".$i." ".$config['snmp']['community'][$i]."\n");
+ $snmp = shell_exec("snmpget -t 0.2 -v2c -c
".$config['snmp']['community'][$i]." $ip sysName.0");
+ if(strstr($snmp, "STRING")) {
+ $community = $config['snmp']['community'][$i];
+ $i=count($config['snmp']['community']) - 1 ;
+ echo("community : ".$community."\n");
+ }
+ }
if(strstr($snmp, "STRING")) {
$hostname = trim(str_replace("SNMPv2-MIB::sysName.0 = STRING:
","", $snmp));
if(mysql_result(mysql_query("SELECT COUNT(device_id) FROM devices
WHERE hostname = '$hostname'"),0) == '0') {
root@eos:/opt#
--
GRTNX,
RobJE