Apply "Squiz" code style on old (pre-2014) files

This commit is contained in:
Job Snijders
2015-07-10 13:36:21 +02:00
parent e4f4eb44dc
commit ebd0f6fc35
539 changed files with 13591 additions and 13223 deletions

View File

@@ -1,26 +1,28 @@
<?php
// Polls Apache statistics from script via SNMP
if (!empty($agent_data['app']['apache']))
{
$apache = $agent_data['app']['apache'];
} else {
$options = "-O qv";
$oid = "nsExtendOutputFull.6.97.112.97.99.104.101";
$apache = snmp_get($device, $oid, $options);
if (!empty($agent_data['app']['apache'])) {
$apache = $agent_data['app']['apache'];
}
else {
$options = '-O qv';
$oid = 'nsExtendOutputFull.6.97.112.97.99.104.101';
$apache = snmp_get($device, $oid, $options);
}
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd";
echo(" apache");
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-apache-'.$app['app_id'].'.rrd';
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);
echo ' apache';
if (!is_file($rrd_filename))
{
rrdtool_create($rrd_filename, "--step 300 \
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 \
@@ -40,9 +42,8 @@ if (!is_file($rrd_filename))
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 ".$config['rrd_rra']);
}
DS:sb_open:GAUGE:600:0:125000000000 '.$config['rrd_rra']
);
}//end if
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");
?>
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");