mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 23:31:58 +01:00
revised cpu stat collection
This commit is contained in:
parent
54bd64387a
commit
a4e0042e57
@ -7,7 +7,6 @@ piler's crontab:
|
||||
|
||||
### mandatory
|
||||
|
||||
*/5 * * * * LC_ALL=C mpstat | tail -1 | awk '{print $11}' > /var/piler/stat/cpu.stat
|
||||
5,35 * * * * LIBEXECDIR/piler/indexer.delta.sh
|
||||
30 2 * * * LIBEXECDIR/piler/indexer.main.sh
|
||||
*/15 * * * * /usr/local/bin/indexer --quiet tag1 --rotate
|
||||
|
@ -284,8 +284,6 @@ make_cron_entries() {
|
||||
|
||||
echo ""
|
||||
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 "30 2 * * * $LIBEXECDIR/piler/indexer.main.sh" >> $CRON_TMP
|
||||
echo "*/15 * * * * $INDEXER --quiet tag1 --rotate" >> $CRON_TMP
|
||||
|
@ -193,6 +193,7 @@ $config['SPHINX_NOTE_INDEX'] = 'note1';
|
||||
|
||||
$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['CPU_USAGE_COMMAND'] = "LC_ALL=C mpstat | tail -1 | awk '{print $11}'";
|
||||
|
||||
$config['LDAP_IMPORT_CONFIG_FILE'] = '/usr/local/etc/ldap-import.cfg';
|
||||
|
||||
|
@ -50,7 +50,8 @@ class ControllerHealthWorker extends Controller {
|
||||
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user