librenms/includes/polling/apachestats.inc.php
Adam Amstrong 352188f0b3 add apachepoller
git-svn-id: http://www.observium.org/svn/observer/trunk@162 61d68cd4-352d-0410-923a-c4978735b2b8
2008-03-15 18:02:43 +00:00

31 lines
815 B
PHP
Executable File

<?php
echo("Collecting Apache statistics...");
$apacherrd = "rrd/" . $device['hostname'] . "-apache.rrd";
if(!is_file($apacherrd)) {
$woo= `rrdtool create $apacherrd \
DS:bits:COUNTER:600:U:10000000 \
DS:hits:COUNTER:600:U:10000000 \
RRA:AVERAGE:0.5:1:800 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:800 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797`;
}
$this_host = $device['hostname'];
list($ahits,$abits) = explode("\n", `./get-apache.sh $this_host`);
$abits = $abits * 8;
rrdtool_update($apacherrd,"N:$abits:$ahits");
echo("\n");
?>