Page 1 of 3

Notification clarification needed

Posted: Thu May 07, 2015 10:55 am
by BanditBBS
Ok. so here is the state history and also notification history for a disk service on a server:
state.png
notifications.PNG
As you can see, it went critical then warning, then critical on 2/25 and the service desk acknowledged the issue. That was the last notification that was sent even though the service was bouncing between warning and critical over the next two months. It was acknowledged when critical, when it went back to warning and then back to critical shouldn't it have sent a notification again?

Re: Notification clarification needed

Posted: Thu May 07, 2015 11:30 am
by ssax
Did the person who acknowledged it select the "sticky" option? If the "sticky" option is set, the acknowledgement will remain until the service returns to an OK state, if it's not set then the acknowledgement will automatically be removed when the service changes state.

So if he set it to sticky and it never went to OK, the acknowledgement would have stayed and you wouldn't have received a notification.

Re: Notification clarification needed

Posted: Thu May 07, 2015 11:36 am
by BanditBBS
ssax wrote:Did the person who acknowledged it select the "sticky" option? If the "sticky" option is set, the acknowledgement will remain until the service returns to an OK state, if it's not set then the acknowledgement will automatically be removed when the service changes state.

So if he set it to sticky and it never went to OK, the acknowledgement would have stayed and you wouldn't have received a notification.
Thanks for clarification......I'd really love to change the default check boxes on the acknowledge screen to uncheck the sticky and send ack and check the persistent comment.

Re: Notification clarification needed

Posted: Thu May 07, 2015 12:07 pm
by tmcdonald
Could always recompile Core. I'm working on a patch for you, just a sec.

Edit: Looks like ssax beat me to it. I did one in C, he did one in PHP.

Including mine for reference. Apply the patch then re-run the upgrade script from the install directory. If you do patch it, make sure to hit "yes" if it asks about already-applied patches. There is one patch for the upgrade script, and another for the cgi/cmd.c file.

Re: Notification clarification needed

Posted: Thu May 07, 2015 12:16 pm
by ssax
Edit: This is for the Mass Acknowledge page.

This will precheck and clear what you would like:
*** If you upgrade XI or the component it will get reverted.

Edit (Around line 76):

Code: Select all

/usr/local/nagiosxi/html/includes/components/massacknowledge/mass_ack.php
Change:

Code: Select all

<script type="text/javascript">
    $(document).ready(function () {
        $('tr:even').addClass('even');
    });

    var allChecked = false;
    var allCheckedSticky = false;
    var allCheckedNotify = false;
    var allCheckedPersist = false;
To:

Code: Select all

<script type="text/javascript">
    $(document).ready(function () {
        $('tr:even').addClass('even');
        checkAllSticky();
        checkAllNotify();
        checkAllPersist();
    });

    var allChecked = false;
    var allCheckedSticky = true;
    var allCheckedNotify = true;
    var allCheckedPersist = false;

Re: Notification clarification needed

Posted: Thu May 07, 2015 12:32 pm
by BanditBBS
tmcdonald wrote:Could always recompile Core. I'm working on a patch for you, just a sec.

Edit: Looks like ssax beat me to it. I did one in C, he did one in PHP.

Including mine for reference. Apply the patch then re-run the upgrade script from the install directory. If you do patch it, make sure to hit "yes" if it asks about already-applied patches. There is one patch for the upgrade script, and another for the cgi/cmd.c file.
ssax is for the mass acknowledge component, so I'll do the recompile core method. Our service desk gets the alerts, opens a task and then uses the rr link to go acknowledge the notification so I think I need to modify that as well since those check boxes don't even exist on that page.

edit: I also want to remove the disable notifications from the rr.php :) Time to code!

Re: Notification clarification needed

Posted: Thu May 07, 2015 12:38 pm
by ssax
Yep, sorry, my mistake! Edited post to reflect that.

Re: Notification clarification needed

Posted: Thu May 07, 2015 12:43 pm
by BanditBBS
Now here is a question for you.

I found in rr.php this code:

Code: Select all

159             if ($service != "") {
160                 $cmdstr = sprintf("%s;%s;%s;1;1;1;%s;%s", "ACKNOWLEDGE_SVC_PROBLEM", $host, $service, $author, $comment);
161             } else {
162                 $cmdstr = sprintf("%s;%s;1;1;1;%s;%s", "ACKNOWLEDGE_HOST_PROBLEM", $host, $author, $comment);
163             }
That code is obviously performing the acknowledge. My question is this, after finding that I browsed to http://old.nagios.org/developerinfo/ext ... mand_id=40 to see what all the fields are. So, the 1;1;1 part is what I need to change, but the document says the first one needs to be 2 to make the acknowledge sticky, why is it sticky if rr.php is setting to 1?

Re: Notification clarification needed

Posted: Thu May 07, 2015 12:56 pm
by tmcdonald
Is this before or after my patch?

Re: Notification clarification needed

Posted: Thu May 07, 2015 12:57 pm
by BanditBBS
tmcdonald wrote:Is this before or after my patch?
I haven't done your patch yet Trevor. I may be able to get away with just the rr.php since that is what our service desk uses to acknowledge.