revised cpu stat collection

This commit is contained in:
SJ 2014-05-02 14:40:39 +02:00
parent 54bd64387a
commit a4e0042e57
4 changed files with 3 additions and 4 deletions

View File

@ -7,7 +7,6 @@ piler's crontab:
### mandatory ### mandatory
*/5 * * * * LC_ALL=C mpstat | tail -1 | awk '{print $11}' > /var/piler/stat/cpu.stat
5,35 * * * * LIBEXECDIR/piler/indexer.delta.sh 5,35 * * * * LIBEXECDIR/piler/indexer.delta.sh
30 2 * * * LIBEXECDIR/piler/indexer.main.sh 30 2 * * * LIBEXECDIR/piler/indexer.main.sh
*/15 * * * * /usr/local/bin/indexer --quiet tag1 --rotate */15 * * * * /usr/local/bin/indexer --quiet tag1 --rotate

View File

@ -284,8 +284,6 @@ make_cron_entries() {
echo "" echo ""
echo "### PILERSTART" >> $CRON_TMP echo "### PILERSTART" >> $CRON_TMP
echo "*/5 * * * * LC_ALL=C mpstat | tail -1 | awk '{print \$11}' > $LOCALSTATEDIR/piler/stat/cpu.stat" >> $CRON_TMP
echo "5,35 * * * * $LIBEXECDIR/piler/indexer.delta.sh" >> $CRON_TMP echo "5,35 * * * * $LIBEXECDIR/piler/indexer.delta.sh" >> $CRON_TMP
echo "30 2 * * * $LIBEXECDIR/piler/indexer.main.sh" >> $CRON_TMP echo "30 2 * * * $LIBEXECDIR/piler/indexer.main.sh" >> $CRON_TMP
echo "*/15 * * * * $INDEXER --quiet tag1 --rotate" >> $CRON_TMP echo "*/15 * * * * $INDEXER --quiet tag1 --rotate" >> $CRON_TMP

View File

@ -193,6 +193,7 @@ $config['SPHINX_NOTE_INDEX'] = 'note1';
$config['RELOAD_COMMAND'] = 'sudo -n /etc/init.d/rc.piler reload'; $config['RELOAD_COMMAND'] = 'sudo -n /etc/init.d/rc.piler reload';
$config['PILERIMPORT_IMAP_COMMAND'] = '/usr/local/bin/pilerimport -d /var/piler/imap -q -r'; $config['PILERIMPORT_IMAP_COMMAND'] = '/usr/local/bin/pilerimport -d /var/piler/imap -q -r';
$config['CPU_USAGE_COMMAND'] = "LC_ALL=C mpstat | tail -1 | awk '{print $11}'";
$config['LDAP_IMPORT_CONFIG_FILE'] = '/usr/local/etc/ldap-import.cfg'; $config['LDAP_IMPORT_CONFIG_FILE'] = '/usr/local/etc/ldap-import.cfg';

View File

@ -50,7 +50,8 @@ class ControllerHealthWorker extends Controller {
list ($this->data['uptime'], $this->data['cpuload']) = $this->model_health_health->uptime(); list ($this->data['uptime'], $this->data['cpuload']) = $this->model_health_health->uptime();
$this->data['cpuinfo'] = 100 - (int)file_get_contents(CPUSTAT); $x = system(CPU_USAGE_COMMAND);
$this->data['cpuinfo'] = 100 - (int)$x;
$this->data['quarantinereportinfo'] = @file_get_contents(DAILY_QUARANTINE_REPORT_STAT); $this->data['quarantinereportinfo'] = @file_get_contents(DAILY_QUARANTINE_REPORT_STAT);