Page 1 of 1

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

Posted: Mon Oct 07, 2013 3:36 pm
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,

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

Posted: Mon Oct 07, 2013 3:42 pm
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!

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

Posted: Mon Oct 07, 2013 5:09 pm
by questrad

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

Posted: Tue Oct 08, 2013 9:42 am
by slansing
Thank you, we are looking into this and well keep you up to date either on here or the tracker.