Ad Widget

Collapse

Patch: Show ZABBIX Server status in header

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freak
    Member
    • Oct 2007
    • 52

    #1

    Patch: Show ZABBIX Server status in header

    I find it quite convenient to always be able to see if my ZABBIX server is currently running.

    This is a small patch for current trunk (trunk/frontends/php/include/page_header.php@4893), based on report1.php:

    PHP Code:
    --- trunk-orig/frontends/php/include/page_header.php    2007-10-31 15:25:41.000000000 +0100
    +++ trunk/frontends/php/include/page_header.php    2007-11-08 12:19:02.000000000 +0100
    @@ -389,12 +389,18 @@
         {
     
    COpt::compare_files_with_menu($ZBX_MENU);
     
    +
    // Show ZABBIX Server status in header
    +        $status get_status();
    +        
    $zbx_srv_status = array(S_ZABBIX_SERVER_IS_RUNNING": ", new CSpan($status["zabbix_server"], ($status["zabbix_server"] == S_YES "off" "on")));
    +        
    $zbx_srv_status = new CLink($zbx_srv_status"report1.php""small_font");
    +        
    $zbx_srv_status->SetTarget('_self');
    +
             
    $help = new CLink(S_HELP"http://www.zabbix.com/manual/v1.4""small_font");
             
    $help->SetTarget('_blank');
             
    $support = new CLink(S_GET_SUPPORT"http://www.zabbix.com/support.php""small_font");
             
    $support->SetTarget('_blank');
             
    -        
    $page_header_r_col = array($help,array("|"$support));
    +        
    $page_header_r_col = array($zbx_srv_status"|"$help, array("|"$support));
             if(
    $USER_DETAILS["alias"] != ZBX_GUEST_USER){
                 
    $page_header_r_col[] = array("|"
                             new 
    CLink(S_PROFILE"profile.php""small_font"),"|"
  • bbrendon
    Senior Member
    • Sep 2005
    • 870

    #2
    My opinion is that you should always assume zabbix is running. Having it in the header would just make you paranoid.

    I have a separate script that monitors zabbix because zabbix WILL crash on a very rare occasion. And if it does you will most likely not expect it or notice it immediately because 99.9 % of the time its humming along wonderfully.
    Unofficial Zabbix Expert
    Blog, Corporate Site

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      Originally posted by infinity005
      My opinion is that you should always assume zabbix is running. Having it in the header would just make you paranoid.
      I tend to agree with you!
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • freak
        Member
        • Oct 2007
        • 52

        #4
        I deactivated the server to test some stuff, then went away for the weekend.. when I came back I wondered why I hadn't gotten any new data over the weekend.
        Until I finally remembered I had deactivated the server.

        Maybe one could only show the message if the server is currently down. Because this tends to mean something's going terribly wrong

        I'll change that and upload a new patch.

        Comment

        • freak
          Member
          • Oct 2007
          • 52

          #5
          Here's the new patch

          PHP Code:
          --- trunk-orig/frontends/php/include/page_header.php    2007-10-31 15:25:41.000000000 +0100
          +++ trunk/frontends/php/include/page_header.php    2007-11-12 14:07:17.000000000 +0100
          @@ -389,12 +389,21 @@
               {
           
          COpt::compare_files_with_menu($ZBX_MENU);
           
          +
          // Show ZABBIX Server status in header
          +        $status get_status();
          +        
          $zbx_srv_status "";
          +        if(
          $status["zabbix_server"] != S_YES) {
          +            
          $zbx_srv_status = array(new CSpan("<strong>".S_ZABBIX_SERVER_IS_RUNNING.": ".$status["zabbix_server"]."</strong>""on"), "|");
          +            
          $zbx_srv_status = new CLink($zbx_srv_status"report1.php""small_font");
          +            
          $zbx_srv_status->SetTarget('_self');
          +        }
          +
                   
          $help = new CLink(S_HELP"http://www.zabbix.com/manual/v1.4""small_font");
                   
          $help->SetTarget('_blank');
                   
          $support = new CLink(S_GET_SUPPORT"http://www.zabbix.com/support.php""small_font");
                   
          $support->SetTarget('_blank');
                   
          -        
          $page_header_r_col = array($help,array("|"$support));
          +        
          $page_header_r_col = array($zbx_srv_status$help, array("|"$support));
                   if(
          $USER_DETAILS["alias"] != ZBX_GUEST_USER){
                       
          $page_header_r_col[] = array("|"
                                   new 
          CLink(S_PROFILE"profile.php""small_font"),"|"
          It would be nice to have a S_ZABBIX_SERVER_NOT_RUNNING..

          Comment

          Working...