Mass Acknowledge doesn't seem to work

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Mass Acknowledge doesn't seem to work

Post by vmesquita »

The mass acknowledge plugin seems to have stopped working. I receive the message "Commands processed successfully! Your command submissions may take a few moments to update in the display.". But the service doesn't dissaperar from operations center or becomes listed in the "Acknowledgements and Comments" area.

How can I fix this?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Mass Acknowledge doesn't seem to work

Post by mbellerue »

Looks like we have a couple of mass acknowledge plugins on the Nagios Exchange. Can you post a link to the one that you're using. We can take a look and see what the problem may be.

Also, did this start happening after an upgrade of Nagios XI? Or were there any other major changes that occurred on the system around the same time as the plugin ceasing to work?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Mass Acknowledge doesn't seem to work

Post by vmesquita »

Hello!

We have a upgrade last week but probably Mass Acknowledge has been used already meanwhile. This is the plugin we are using:
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Mass Acknowledge doesn't seem to work

Post by mbellerue »

Okay, can you perform a mass acknowledge, and then download a system profile? After performing the mass acknowledge, go to Admin -> System Profile -> Download Profile. PM that file to me, and I will track down why your system is not acknowledging the alerts.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
PeterDK
Posts: 25
Joined: Tue Jun 05, 2018 9:19 am

Re: Mass Acknowledge doesn't seem to work

Post by PeterDK »

Hi,

FYI,
we are having the same issue after upgrading today to version 5.6.7 and Nagios core 4.4.5 (coming from XI 5.5.7 and core 4.2.4)
But we don't have that problem on our QA environment which was already on 5.6.7 for a long time.

Kind regards,
Peter
PeterDK
Posts: 25
Joined: Tue Jun 05, 2018 9:19 am

Re: Mass Acknowledge doesn't seem to work

Post by PeterDK »

Hi,

I found a workaround.
The problem in our environment was located in the /usr/local/nagiosxi/html/includes/components/massacknowledge/index.php file.
At line 509 in the "massacknowledge_exec_script" there is this part of code:

Code: Select all

// Set our locale for PHP
    // If we don't do this, escapeshellcmd will remove all unicode.
    $locale = grab_array_var($_SESSION, 'language', 'en_US');
    if ($locale == 'en_EN') {
        $locale = 'en_US';
    }
    if (FALSE == setlocale(LC_ALL, $locale.".UTF-8")) {
        return FALSE;
    }
The problem was that the session language was plain "en" instead of "en_US".
The setlocale returned FALSE and exited the function.

The difference between our 2 environments (QA and PR) is that on QA we upgraded php already to version 7 and PR is still on 5.4.
Next week I'm upgrading PHP on our PR as well, I will test with the original code after that.

Workaround:

Code: Select all

 // Set our locale for PHP
    // If we don't do this, escapeshellcmd will remove all unicode.
    $locale = grab_array_var($_SESSION, 'language', 'en_US');
    if ($locale == 'en_EN' || $locale == 'en') {
        $locale = 'en_US';
    }

    if (FALSE == setlocale(LC_ALL, $locale.".UTF-8")) {
        return FALSE;
    }
Kind regards,
Peter
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Mass Acknowledge doesn't seem to work

Post by scottwilkerson »

re-opened per request
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Mass Acknowledge doesn't seem to work

Post by vmesquita »

I just tested this workaround and it seems to fix the issue here too.
PeterDK wrote:Hi,

I found a workaround.
The problem in our environment was located in the /usr/local/nagiosxi/html/includes/components/massacknowledge/index.php file.
At line 509 in the "massacknowledge_exec_script" there is this part of code:

Code: Select all

// Set our locale for PHP
    // If we don't do this, escapeshellcmd will remove all unicode.
    $locale = grab_array_var($_SESSION, 'language', 'en_US');
    if ($locale == 'en_EN') {
        $locale = 'en_US';
    }
    if (FALSE == setlocale(LC_ALL, $locale.".UTF-8")) {
        return FALSE;
    }
The problem was that the session language was plain "en" instead of "en_US".
The setlocale returned FALSE and exited the function.

The difference between our 2 environments (QA and PR) is that on QA we upgraded php already to version 7 and PR is still on 5.4.
Next week I'm upgrading PHP on our PR as well, I will test with the original code after that.

Workaround:

Code: Select all

 // Set our locale for PHP
    // If we don't do this, escapeshellcmd will remove all unicode.
    $locale = grab_array_var($_SESSION, 'language', 'en_US');
    if ($locale == 'en_EN' || $locale == 'en') {
        $locale = 'en_US';
    }

    if (FALSE == setlocale(LC_ALL, $locale.".UTF-8")) {
        return FALSE;
    }
Kind regards,
Peter
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Mass Acknowledge doesn't seem to work

Post by scottwilkerson »

Thanks for confirming, this will be added to the 2.2.2 version of the massacknowledge component
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
CBoekhuis
Posts: 233
Joined: Tue Aug 16, 2011 4:55 am

Re: Mass Acknowledge doesn't seem to work

Post by CBoekhuis »

Hi,
we have same issue after update from 5.6.6. ==> 5.6.7. We run centos 6.10 with php 5.3.3.
After applying Peter's workaround i can tell that the issue is fixed on our environmnet.

Regards,
Christian
Locked