health page displays piler version

This commit is contained in:
SJ 2015-03-18 15:22:53 +01:00
parent 78728c2c6e
commit 925b108457
4 changed files with 14 additions and 0 deletions

View File

@ -202,6 +202,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 | rev | awk '{ print $1 }' | rev"; $config['CPU_USAGE_COMMAND'] = "LC_ALL=C mpstat | tail -1 | rev | awk '{ print $1 }' | rev";
$config['PILER_BINARY'] = "/usr/local/sbin/piler";
$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,6 +50,9 @@ 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();
exec(PILER_BINARY . " -v", $a);
$this->data['piler_version'] = $a[0];
$x = exec(CPU_USAGE_COMMAND); $x = exec(CPU_USAGE_COMMAND);
$this->data['cpuinfo'] = 100 - (int)$x; $this->data['cpuinfo'] = 100 - (int)$x;

View File

@ -7,6 +7,11 @@
<h2><i class="icon-dashboard icon-2x pull-left"></i><?php print $sysinfo[0]; ?> <small><?php print $text_status; ?></small></h2> <h2><i class="icon-dashboard icon-2x pull-left"></i><?php print $sysinfo[0]; ?> <small><?php print $text_status; ?></small></h2>
<h3><strong>Up For:</strong> <?php print $uptime; ?></h3> <h3><strong>Up For:</strong> <?php print $uptime; ?></h3>
<table class="table table-striped"> <table class="table table-striped">
<tr>
<th class="span4">Piler:</th>
<td class="span8"> <?php print $piler_version; ?></td>
</tr>
<tr> <tr>
<th class="span4"><?php print $text_server_operating_system; ?>:</th> <th class="span4"><?php print $text_server_operating_system; ?>:</th>
<td class="span8"> <?php print $sysinfo[1]; ?></td> <td class="span8"> <?php print $sysinfo[1]; ?></td>

View File

@ -12,6 +12,11 @@
<div class="cellhealthright"><?php print $sysinfo[0]; ?></div> <div class="cellhealthright"><?php print $sysinfo[0]; ?></div>
</div> </div>
<div class="row">
<div class="cellhealthleft">Piler</div>
<div class="cellhealthright"><?php print $piler_version; ?></div>
</div>
<div class="row"> <div class="row">
<div class="cellhealthleft"><?php print $text_server_operating_system; ?></div> <div class="cellhealthleft"><?php print $text_server_operating_system; ?></div>
<div class="cellhealthright"><?php print $sysinfo[1]; ?></div> <div class="cellhealthright"><?php print $sysinfo[1]; ?></div>