More colorful monitoring output

* Added colorized start/end times
* Added Success/Error image for Active status
* Added color to runtime status
This commit is contained in:
Sebastian Grewe 2013-07-22 16:42:23 +02:00
parent ee5e2c46c6
commit 4b6582ac35
2 changed files with 41 additions and 29 deletions

View File

@ -15,64 +15,64 @@ $aCronStatus = array(
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('statistics_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('statistics_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('statistics_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('statistics_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('statistics_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('statistics_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('statistics_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('statistics_message') ),
),
'auto_payout' => array (
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('auto_payout_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('auto_payout_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('auto_payout_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('auto_payout_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('auto_payout_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('auto_payout_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('auto_payout_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('auto_payout_message') ),
),
'manual_payout' => array (
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('manual_payout_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('manual_payout_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('manual_payout_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('manual_payout_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('manual_payout_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('manual_payout_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('manual_payout_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('manual_payout_message') ),
),
'archive_cleanup' => array (
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('archive_cleanup_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('archive_cleanup_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('archive_cleanup_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('archive_cleanup_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('archive_cleanup_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('archive_cleanup_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('archive_cleanup_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('archive_cleanup_message') ),
),
'blockupdate' => array (
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('blockupdate_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('blockupdate_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('blockupdate_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('blockupdate_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('blockupdate_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('blockupdate_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('blockupdate_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('blockupdate_message') ),
),
'findblock' => array (
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('findblock_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('findblock_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('findblock_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('findblock_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('findblock_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('findblock_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('findblock_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('findblock_message') ),
),
'notifications' => array (
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('notifications_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('notifications_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('notifications_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('notifications_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('notifications_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('notifications_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('notifications_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('notifications_message') ),
),
'tickerupdate' => array (
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('tickerupdate_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('tickerupdate_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('tickerupdate_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('tickerupdate_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('tickerupdate_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('tickerupdate_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('tickerupdate_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('tickerupdate_message') ),
)
);
@ -83,8 +83,8 @@ case 'pplns':
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('pplns_payout_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('pplns_payout_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('pplns_payout_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('pplns_payout_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('pplns_payout_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('pplns_payout_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('pplns_payout_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('pplns_payout_message') ),
);
break;
@ -93,8 +93,8 @@ case 'pps':
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('pps_payout_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('pps_payout_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('pps_payout_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('pps_payout_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('pps_payout_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('pps_payout_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('pps_payout_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('pps_payout_message') ),
);
break;
@ -103,8 +103,8 @@ case 'prop':
array( 'NAME' => 'Exit Code', 'STATUS' => $monitoring->getStatus('proportional_payout_status') ),
array( 'NAME' => 'Active', 'STATUS' => $monitoring->getStatus('proportional_payout_active') ),
array( 'NAME' => 'Runtime', 'STATUS' => $monitoring->getStatus('proportional_payout_runtime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('proportional_payout_starttime') ),
array( 'NAME' => 'Last Run', 'STATUS' => $monitoring->getStatus('proportional_payout_endtime') ),
array( 'NAME' => 'Start Time', 'STATUS' => $monitoring->getStatus('proportional_payout_starttime') ),
array( 'NAME' => 'End Time', 'STATUS' => $monitoring->getStatus('proportional_payout_endtime') ),
array( 'NAME' => 'Last Message', 'STATUS' => $monitoring->getStatus('proportional_payout_message') ),
);
break;

View File

@ -24,15 +24,27 @@
{else if $event.STATUS.type == 'message'}
<i>{$event.STATUS.value}</i>
{else if $event.STATUS.type == 'yesno'}
{if $event.STATUS.value == 1}
Yes
{else}
No
{/if}
<img src="{$PATH}/images/{if $event.STATUS.value == 1}success{else}error{/if}.gif" />
{else if $event.STATUS.type == 'time'}
{$event.STATUS.value|default:"0"|number_format:"2"} seconds
{if $event.STATUS.value > 60}
<font color="orange">
{else if $event.STATUS.value > 120}
<font color="red">
{else}
<font color="green">
{/if}
{$event.STATUS.value|default:"0"|number_format:"2"} seconds
</font>
{else if $event.STATUS.type == 'date'}
{$event.STATUS.value|date_format:"%m/%d %H:%M:%S"}
{if $event.STATUS.value < $smarty.now - 120}
<font color="orange">
{else if $event.STATUS.value < $smarty.now - 180}
<font color="red">
{else}
<font color="green">
{/if}
{$event.STATUS.value|date_format:"%m/%d %H:%M:%S"}
</font>
{else}
{$event.STATUS.value|default:""}
{/if}