librenms/includes/polling/applications/apache.inc.php
Tom Laermans c15bfa62a4 syntaxer run + manual cleanup
git-svn-id: http://www.observium.org/svn/observer/trunk@2630 61d68cd4-352d-0410-923a-c4978735b2b8
2011-10-01 10:10:02 +00:00

55 lines
2.3 KiB
PHP

<?php
## Polls Apache statistics from script via SNMP
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd";
$options = "-O qv";
$oid = "nsExtendOutputFull.6.97.112.97.99.104.101";
$apache = snmp_get($device, $oid, $options);
echo(" apache");
list ($total_access, $total_kbyte, $cpuload, $uptime, $reqpersec, $bytespersec, $bytesperreq, $busyworkers, $idleworkers,
$score_wait, $score_start, $score_reading, $score_writing, $score_keepalive, $score_dns, $score_closing, $score_logging, $score_graceful, $score_idle, $score_open) = explode("\n", $apache);
if (!is_file($rrd_filename))
{
rrdtool_create($rrd_filename, "--step 300 \
DS:access:DERIVE:600:0:125000000000 \
DS:kbyte:DERIVE:600:0:125000000000 \
DS:cpu:GAUGE:600:0:125000000000 \
DS:uptime:GAUGE:600:0:125000000000 \
DS:reqpersec:GAUGE:600:0:125000000000 \
DS:bytespersec:GAUGE:600:0:125000000000 \
DS:byesperreq:GAUGE:600:0:125000000000 \
DS:busyworkers:GAUGE:600:0:125000000000 \
DS:idleworkers:GAUGE:600:0:125000000000 \
DS:sb_wait:GAUGE:600:0:125000000000 \
DS:sb_start:GAUGE:600:0:125000000000 \
DS:sb_reading:GAUGE:600:0:125000000000 \
DS:sb_writing:GAUGE:600:0:125000000000 \
DS:sb_keepalive:GAUGE:600:0:125000000000 \
DS:sb_dns:GAUGE:600:0:125000000000 \
DS:sb_closing:GAUGE:600:0:125000000000 \
DS:sb_logging:GAUGE:600:0:125000000000 \
DS:sb_graceful:GAUGE:600:0:125000000000 \
DS:sb_idle:GAUGE:600:0:125000000000 \
DS:sb_open:GAUGE:600:0:125000000000 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797");
}
rrdtool_update($rrd_filename, "N:$total_access:$total_kbyte:$cpuload:$uptime:$reqpersec:$bytespersec:$bytesperreq:$busyworkers:$idleworkers:$score_wait:$score_start:$score_reading:$score_writing:$score_keepalive:$score_dns:$score_closing:$score_logging:$score_graceful:$score_idle:$score_open");
?>