Hi everyone,

In a redundant architecture, the failure of a component isn't a problem but we 
can't say that it's an OK state. Here is a proposition to modify compute of 
business rules and change the name of the differents states :

All OK => NOMINAL instead of OK
bp_rules computation return OK but some services are in warning/critical state 
=> DEGRADED instead of OK
bp_rules return KO => NON FONCTIONAL instead of CRITICAL

The attached patch implement this behavior in shinken and thruk. 

Comments are welcome.

Regards,

Nicolas DUPEUX <nicolas.dup...@arkea.com>
Arkea - Domaine Systèmes
tel : 02.98.00.36.68

--- schedulingitem.py	2011-05-20 16:31:28.000000000 +0200
+++ schedulingitem.py.new	2011-05-27 15:10:06.000000000 +0200
@@ -1224,6 +1224,12 @@
         #print "DBG, ask me to manage a check!"
         if c.command.startswith('bp_'):
             state = self.business_rule.get_state()
+            if state == 0:
+                # Check if all elements are in OK state
+                ae = self.business_rule.list_all_elements()
+                aes = [ e for e in ae if e.last_hard_state_id != 0 ]
+                if len(aes) > 0:
+                     state = 1
         elif c.command == '_internal_host_up':
             state = 0
             c.execution_time = 0
--- shinken_businessview.tt.orig	2011-05-27 14:31:39.000000000 +0200
+++ shinken_businessview.tt	2011-05-27 11:32:34.000000000 +0200
@@ -50,13 +50,13 @@
                [% SET s_status_text = 'PENDING' %]
                [% ELSIF service.state == 0 %]
                [% SET s_status = 'serviceOK' %]
-               [% SET s_status_text = 'OK' %]
+               [% SET s_status_text = 'NOMINAL' %]
                [% ELSIF service.state == 1 %]
                [% SET s_status = 'serviceWARNING' %]
-               [% SET s_status_text = 'WARNING' %]
+               [% SET s_status_text = 'DEGRADED' %]
                [% ELSIF service.state == 2 %]
                [% SET s_status = 'serviceCRITICAL' %]
-               [% SET s_status_text = 'CRITICAL' %]
+               [% SET s_status_text = 'NON FONCTIONAL' %]
                [% ELSIF service.state == 3 %]
                [% SET s_status = 'serviceUNKNOWN' %]
                [% SET s_status_text = 'UNKNOWN' %]
@@ -67,6 +67,16 @@
                 <tr class='dataOdd'>
                   <td class='[% s_status %]' width="80">[% s_status_text %]</td>
                   <td><div class='elementTitle'><a href='extinfo.cgi?type=2&amp;host=[% service.host_name | uri %]&amp;service=[% service.description | uri %]&amp;backend=[% service.peer_key %]'>[% service.host_name %]/[% service.description %]</a></div></td>
+                  <td>
+                  [% IF service.notes_url %]
+                  <div class='elementTitle'><a href='[% service.notes_url %]'><img src='[% url_prefix %]thruk/themes/[% theme %]/images/notes.gif' border="0" alt='View Additional Notes For This Service' title='View Additional Notes For This Service' width="20" height="20"></a><br clear="all"></div>
+                  [% END %]
+                  </td>
+                  <td>
+                  [% IF service.action_url %]
+                  <div class='elementTitle'><a href='[% service.action_url %]'><img src='[% url_prefix %]thruk/themes/[% theme %]/images/action.gif' border="0" alt='Perform Additional Actions On This Service' title='Perform Additional Actions On This Service' width="20" height="20"></a><br clear="all"></div>
+                  [% END %]
+                  </td>
               <td class='void'>
               [%# Sublevel list %]
                 <a id="togglelink-son-[% crit.value %]-[% i %]" class="internal" href="javascript:toggleToc('son-[% crit.value %]-[% i %]')"><img id="img-son-[% crit.value %]-[% i %]" src="[% url_prefix %]thruk/plugins/shinken_features/images/go-next.png" alt="Expand/Reduce"> </a>
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to