NagiosXI 2012R2.4b - mass acknowledge does not work

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

NagiosXI 2012R2.4b - mass acknowledge does not work

Post by questrad »

Hello All,

I have issue with mass acknowledge. It stopped to work after upgrade from 2012R1.8
I notice there is changes. They added following:

Code: Select all

    // Set our locale for PHP
    // If we don't do this, escapeshellcmd will remove all unicode.
    $locale = $_SESSION['language'];
    if(FALSE == setlocale(LC_CTYPE, "UTF8", $locale.".UTF-8")) {
        return FALSE;
    }
And the script is always returl FALSE because

Code: Select all

$locale = $_SESSION['language'];
always return in my situation en_EN.
I did couple of investigation and did following changes:
You can remove unnecessary "print".

Code: Select all

   // Set our locale for PHP
    // If we don't do this, escapeshellcmd will remove all unicode.
    $locale = $_SESSION['language'];
    print '<br />';
    print "LC_TYEP:".LC_CTYPE;
    print '<br />';
    $old_locale = setlocale(LC_ALL, '0');
    $bits = explode(';',$old_locale);
    $loc = array();
    foreach($bits as $bit) {
       $value = explode("=",$bit);
       $loc[] = $value[1];
    }
    
    print '<br />'.$old_locale;
    print '<br />'."LOC";
    print_r($loc);
    
    if(FALSE == setlocale(LC_CTYPE, "UTF8", $loc[0])) {
    //setlocale(LC_CTYPE, "UTF8");
    //if(FALSE == setlocale(LC_CTYPE, "UTF8")) {
        print '<br />'."Return from massacknowledge_exec_script";
        print '<br />'."Because locale is:".$locale;
        print '<br />'.$locale.".UTF-8";
        return FALSE;
    }
 
Regards,
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: NagiosXI 2012R2.4b - mass acknowledge does not work

Post by sreinhardt »

Did you happen to post this in tracker.nagios.com? Especially considering you have a potential fix, this would be much appreciated posted there, and will get to our developers faster. thanks!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: NagiosXI 2012R2.4b - mass acknowledge does not work

Post by questrad »

slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NagiosXI 2012R2.4b - mass acknowledge does not work

Post by slansing »

Thank you, we are looking into this and well keep you up to date either on here or the tracker.
Locked