Page 1 of 2

Trailing slash n removal...

Posted: Wed Mar 01, 2017 4:43 pm
by SteveBeauchemin
Once upon a time I saw some information about removing the /n from the end of 'Status Information' data.

I must have implemented that on my old RH 6 system as I have not see those in a very long time.

They are now showing up on my Red Hat 7 Nagios XI 5.4.2 system. Since I did the transition they are there.
Can someone please remind me how to make those go away?

The following are some examples - output from Binary tests, perl tests, scripts...

NRPE v2.16\n
PROCS OK: 1 process with command name 'nsrexecd'\n
ERROR opening session: Received usmStatsWrongDigests.0 Report-PDU with value 1488 during synchronization.\n
UNKNOWN: Interface Admin Down\n

Re: Trailing slash n removal...

Posted: Wed Mar 01, 2017 5:55 pm
by avandemore
The backslash n is for a newline:

http://stackoverflow.com/questions/5904 ... -a-newline

Is this run against NRPE under NSClient or something? Can you show the definition for the remote command?

Re: Trailing slash n removal...

Posted: Wed Mar 01, 2017 6:54 pm
by SteveBeauchemin
Here are some command examples.

This test:

Code: Select all

check_ifstats.pl -b -H $HOSTADDRESS$ -i "$ARG4$" -v "$ARG3$" --username "$ARG1$" --authpassword "$ARG6$" --authprotocol "$ARG7$" -R $USER11$ -r $USER12$
gives these :
UNKNOWN: Interface Admin Down\n
UNKNOWN: Received usmStatsUnknownUserNames.0 Report-PDU with value 174420 during synchronization\n
UNKNOWN: Received usmStatsWrongDigests.0 Report-PDU with value 32036 during synchronization
OK: Interface Ethernet3/2 (index 437260288) is administratively down.\n
OK: Interface Ethernet3/9 (index 437288960) is up.\n

This test:

Code: Select all

check_nrpe -H $HOSTADDRESS$
gives this :
I (0.5.0.62 2016-09-14) seem to be doing fine...\n

This test:

Code: Select all

check_nrpe -u -t 60 -H $HOSTADDRESS$ -c check_rpm_db
gives this :
OK: RPM DB named Packages is clean.\n

This test:

Code: Select all

check_nrpe -u -H $HOSTADDRESS$
gives this :
NRPE v2.15\n

This test:

Code: Select all

check_ssl_expiration.php -a $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
gives this :
OK - 1 Certificate(s) on 131.198.86.153 look ok!\n

So, anyone have any suggestions? Am I the only one noticing this?

Thanks

Steve B

Re: Trailing slash n removal...

Posted: Thu Mar 02, 2017 1:17 pm
by avandemore
Is it present in Core and from the command line as well?

Re: Trailing slash n removal...

Posted: Fri Mar 03, 2017 12:13 pm
by SteveBeauchemin
Testing from command line - no backslash n

Viewing in Core GUI - no trailing slash n anywhere

Only seeing /n in Nagios XI

Thanks

Steve B

Re: Trailing slash n removal...

Posted: Fri Mar 03, 2017 2:44 pm
by dwhitfield
Could you upload or PM your copy of /usr/local/nagiosxi/html/includes/components/xicore/status.php

If you PM, please update the forum thread so it comes back up on our dashboard.

Re: Trailing slash n removal...

Posted: Mon Mar 06, 2017 11:18 am
by SteveBeauchemin
Requested file is attached
Created using this syntax

Code: Select all

tar -czvf /tmp/xicore-stat-php.tar.gz status.php
FYI - All the time stamps of files in that directory are the same

Steve B

Re: Trailing slash n removal...

Posted: Mon Mar 06, 2017 3:03 pm
by dwhitfield
log in to mysql/mariadb, and then give the output of the select statements.

Code: Select all

use nagios;
select output from nagios_servicestatus;
select long_output from nagios_servicestatus;

Re: Trailing slash n removal...

Posted: Mon Mar 06, 2017 3:10 pm
by SteveBeauchemin
Good one... I have 42 thousand + services. This could be scrolling for a long time.

Ran this one only...

Code: Select all

select output from nagios_servicestatus;
I can see the /n in that output.

Still scrollong...

Steve B

Re: Trailing slash n removal...

Posted: Mon Mar 06, 2017 4:49 pm
by dwhitfield
Can you restart without livestatus and see if the issue remains?

Also, I spoke to the devs about this, and they suggested running through https://support.nagios.com/kb/article.php?id=409 -- 2014, you say? Yes, that was my response, but at this point I think we need to look at all the options.