fixes to mailscanner and ntp-client snmp injection

git-svn-id: http://www.observium.org/svn/observer/trunk@2635 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-10-02 21:27:37 +00:00
parent 4db9afe9f2
commit edf7f7aaac
2 changed files with 22 additions and 3 deletions

View File

@@ -54,7 +54,22 @@
echo $count."\n";
}
}
function clearStats($mailstats) {
if (file_exists($mailstats) {
$fp = fopen($mailstats, 'w');
fwrite($fp, "mess_recv:0\n");
fwrite($fp, "mess_rejected:0\n");
fwrite($fp, "mess_relay:0\n");
fwrite($fp, "mess_sent:0\n");
fwrite($fp, "mess_waiting:0\n");
fwrite($fp, "spam:0\n");
fwrite($fp, "virus:0\n");
fclose($fp);
}
}
doSNMPv2($mailstats);
$fp = fopen($mailstats, 'w');
fwrite($fp, "mess_recv:0\n");
clearStats($mailstats);
?>

View File

@@ -32,7 +32,11 @@
########################################################################################
$cmd = shell_exec($ntpq." -c rv | grep '^offset'");
$cmd2 = shell_exec($ntpq." -c rv | grep '^stability'");
if ($newstats_style) {
$cmd2 = shell_exec($ntpq." -c rv | grep '^clk_wander'");
} else {
$cmd2 = shell_exec($ntpq." -c rv | grep '^stability'");
}
$vars = array();
$vars2 = array();
$vars = explode(',', $cmd);