mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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);
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user