Trailing slash n removal...

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Trailing slash n removal...

Post 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
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Trailing slash n removal...

Post 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?
Previous Nagios employee
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Trailing slash n removal...

Post 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
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Trailing slash n removal...

Post by avandemore »

Is it present in Core and from the command line as well?
Previous Nagios employee
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Trailing slash n removal...

Post 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
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Trailing slash n removal...

Post 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.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Trailing slash n removal...

Post 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
You do not have the required permissions to view the files attached to this post.
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Trailing slash n removal...

Post 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;
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Trailing slash n removal...

Post 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
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Trailing slash n removal...

Post 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.
Last edited by dwhitfield on Mon Mar 06, 2017 5:05 pm, edited 1 time in total.
Reason: mod_gearman link
Locked