update nginx application poller to use snmp_get

git-svn-id: http://www.observium.org/svn/observer/trunk@3149 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-08 10:50:24 +00:00
parent e39ac789a8
commit c0b8070ff0

View File

@@ -5,10 +5,7 @@ if (!empty($agent_data['app']['nginx']))
$nginx = $agent_data['app']['nginx'];
} else {
# Polls nginx statistics from script via SNMP
$nginx_cmd = $config['snmpget'] ." -m NET-SNMP-EXTEND-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
$nginx_cmd .= " nsExtendOutputFull.5.110.103.105.110.120";
$nginx = shell_exec($nginx_cmd);
$nginx = snmp_get($device, "nsExtendOutputFull.5.110.103.105.110.120", "-Ovq", "NET-SNMP-EXTEND-MIB");
}
$nginx_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-nginx-".$app['app_id'].".rrd";
@@ -29,4 +26,13 @@ if (!is_file($nginx_rrd))
print "active: $active reading: $reading writing: $writing waiting: $waiting Requests: $req";
rrdtool_update($nginx_rrd, "N:$req:$active:$reading:$writing:$waiting");
/// Unset the variables we set here
unset($nginx);
unset($nginx_rrd);
unset($active);
unset($reading);
unset($writing);
unset($req);
?>