multi-line plugin results - only getting the first line

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

multi-line plugin results - only getting the first line

Post by SteveBeauchemin »

I just upgraded to Nagios XI 5.5.8 - was on Nagios XI 5.4.12.

Fixed all the anomalies such as inconsistent nagios.lock locations and such. Maybe self inflicted, I don't know.

But everything is now running really good.

Except for one thing. A big thing.

I have a log scrape test that returns multiple log entries when it finds matching data.

The nagios.log data from Before the upgrade shows all the data sent from the plugin.

The nagios.log data from After the upgrade shows only the first line up to the first \n

This is very bad for me because the data that I need to use is on the additional lines.

Is multi line Status information in the Nagios GUI controlled by some setting now? Or worse, is it gone?

I need my extended data in the Nagios Alerting. The nagios.log SERVICE ALERT: now only shows partial data for me.

This is a really big one for me. Can someone help please?

Here are some nagios.log lines from Before and After. One Service Alert and one Service Notification before and after.

Code: Select all

before upgrade
[1544064804] SERVICE ALERT: mousrtws.rockwellcollins.com;Check_Log_Maestro;CRITICAL;HARD;1;CRITICAL - (1 errors in maestro.protocol-2018-12-05-20-53-23) - 101 BW1X             0AAAAAAAAAAFZI7C XPC_XMM_XRSBAR281                        BW1X             19251 5 XPC_XMM_XRSBAR281                        twsbw1 /\\040-job\\040XPC_XMM_XRSBAR281\\040-i\\040pchain_\\040-c\\040c 0400 10 2018120520520000 0      +++      22945 0 1544026200 1544026200 2040 0 1 0AAAAAAAAAAFZI7C 662          BWDA170 2018120500100000 v.4 NONE NONE 4 NONE NONE NONE 0 0 0 0 0 NONE \ntag maestro CRITICAL\n101 BW1X             0AAAAAAAAAAFZI7C XPC_XMM_XRSBAR281                        BW1X             19251 5 XPC_XMM_XRSBAR281                        twsbw1 /\\040-job\\040XPC_XMM_XRSBAR281\\040-i\\040pchain_\\040-c\\040c 0400 10 2018120520520000 0      +++      22945 0 1544026200 1544026200 2040 0 1 0AAAAAAAAAAFZI7C 662          BWDA170 2018120500100000 v.4 NONE NONE 4 NONE NONE NONE 0 0 0 0 0 NONE\n\n\n
[1544064804] SERVICE NOTIFICATION: POC15;mousrtws.rockwellcollins.com;Check_Log_Maestro;CRITICAL;service-notify-by-snt;CRITICAL - (1 errors in maestro.protocol-2018-12-05-20-53-23) - 101 BW1X             0AAAAAAAAAAFZI7C XPC_XMM_XRSBAR281                        BW1X             19251 5 XPC_XMM_XRSBAR281                        twsbw1 /\\040-job\\040XPC_XMM_XRSBAR281\\040-i\\040pchain_\\040-c\\040c 0400 10 2018120520520000 0  +++      22945 0 1544026200 1544026200 2040 0 1 0AAAAAAAAAAFZI7C 662          BWDA170 2018120500100000 v.4 NONE NONE 4 NONE NONE NONE 0 0 0 0 0 NONE \ntag maestro CRITICAL\n101 BW1X             0AAAAAAAAAAFZI7C XPC_XMM_XRSBAR281                        BW1X             19251 5 XPC_XMM_XRSBAR281                        twsbw1 /\\040-job\\040XPC_XMM_XRSBAR281\\040-i\\040pchain_\\040-c\\040c 0400 10 2018120520520000 0      +++      22945 0 1544026200 1544026200 2040 0 1 0AAAAAAAAAAFZI7C 662          BWDA170 2018120500100000 v.4 NONE NONE 4 NONE NONE NONE 0 0 0 0 0 NONE\n\n\n

after upgrade
[1547103736] SERVICE ALERT: mousrtws.rockwellcollins.com;Check_Log_Maestro;CRITICAL;HARD;1;CRITICAL - (1 errors in maestro.protocol-2019-01-10-01-02-15) - 101 BT1X             0AAAAAAAAAAF2WQ7 XPC_X950_XSDT683S_001                    BT1X             3721 5 XPC_X950_XSDT683S_001                    twsbt1 /\040-job\040XPC_X950_XSDT683S_001\040-i\040pchain_\040-c\040c -32768 1 2019011001020000 0        +++      20 0 1547082120 0 120 0 40 0AAAAAAAAAAF2WQ7 20          BWDA156 2019011001020000 v.4 NONE NONE 4 NONE NONE NONE 0 0 0 0 0 NONE
[1547103736] SERVICE NOTIFICATION: POC15;mousrtws.rockwellcollins.com;Check_Log_Maestro;CRITICAL;service-notify-by-snt;CRITICAL - (1 errors in maestro.protocol-2019-01-10-01-02-15) - 101 BT1X             0AAAAAAAAAAF2WQ7 XPC_X950_XSDT683S_001                    BT1X             3721 5 XPC_X950_XSDT683S_001                    twsbt1 /\040-job\040XPC_X950_XSDT683S_001\040-i\040pchain_\040-c\040c -32768 1 2019011001020000 0    +++      20 0 1547082120 0 120 0 40 0AAAAAAAAAAF2WQ7 20          BWDA156 2019011001020000 v.4 NONE NONE 4 NONE NONE NONE 0 0 0 0 0 NONE
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
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: multi-line plugin results - only getting the first line

Post by SteveBeauchemin »

Is there a solution? Has this been verified by others? Is it only me?

Please help.

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
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: multi-line plugin results - only getting the first line

Post by cdienger »

Which plugin are you using and does it show all the lines if you run it on the command line?

I've done some testing on with versions of XI you mentioned but they seem to be behaving the same which makes me think maybe it's something related to the plugin.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: multi-line plugin results - only getting the first line

Post by SteveBeauchemin »

So... Did my Due Dilligence...

I installed Centos 7 fresh on a system - minimal install.

Did a yum -y upgrade

Rebooted.

Installed Nagios XI 5.5.8

Answered the GUI question and have localhost in Status Information and everything is green.

So - one host, couple services.

Now I added a dummy test that returns 2 lines of output.

Code: Select all

cat check_dummy_ovo.pl
#!/usr/bin/perl
#
# Version 0.0.1 - 2015-03-02
# Dummy test substitute
# by Steven Beauchemin

my $state = $ARGV[0];
my $line1 = $ARGV[1];
my $line2 = $ARGV[2];

print $line1 . "\n" . $line2 . "\n";
exit $state;
Running from the OS prompt gives me:

Code: Select all

./check_dummy_ovo.pl 0 "Testing Line 1" "Testing Line 2"
Testing Line 1
Testing Line 2
Then I added a command

Code: Select all

define command {
    command_name    check-dummy-service-multi-line-response
    command_line    /usr/local/libexec/check_dummy_ovo.pl $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$
}
then I added a service to use the command

Code: Select all

define service {
    host_name              localhost
    service_description    _Dummy_Test_for_multiline_status_information
    use                    local-service
    check_command          check-dummy-service-multi-line-response!0!"Testing Line 1 of status screen"!"Testing Line 2 of status screen"!!!!!
    notification_period    none
    icon_image             pentagram.png
    register               1
}
This is the Status Information GUI
Status-Info.PNG
Status Detail shows up at the bottom for some reason...

When I drilled in and made it send a message, the Nagios log showed this line

Code: Select all

[1547498493] SERVICE NOTIFICATION: nagiosadmin;localhost;_Dummy_Test_for_multiline_status_information;CUSTOM (OK);xi_service_notification_ha  ndler;Testing Line 1 of status screen;Nagios Admin;testing
The email I get is this.

Code: Select all

***** Nagios XI Alert *****



Notification Type: CUSTOM

Service: _Dummy_Test_for_multiline_status_information
Host: localhost
Address: 127.0.0.1
State: OK
Info:
Testing Line 1 of status screen
Date/Time: 2019-01-14 12:46:02
...
So I believe I have shown that Multiline Test results are not being displayed properly in the GUI. The Notification Email does not contain the data either. The Service Detail is showing the data.

All this on a Clean OS, Fresh Nagios XI, one service test added.

I require that the Status Information show all the lines. I require that Notifications show the complete data.

Please help.

Thanks

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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: multi-line plugin results - only getting the first line

Post by lmiltchev »

I believe the "Service Status" page always showed only the first line of the output. On the other hand, the "Service Status Detail" page shows all lines (multi-line output).

As far as notifications goes, you will need to have the long service output defined in your notification command (this part):

Code: Select all

...--longserviceoutput="$LONGSERVICEOUTPUT$"...
and both of these lines in the "Service Alert Message":

Code: Select all

Info:
%serviceoutput%
%longserviceoutput%
For more information see this:
https://assets.nagios.com/downloads/nag ... iables.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: multi-line plugin results - only getting the first line

Post by SteveBeauchemin »

I have resolved my concerns about the multi-lines.

I am now using <BR> in the plugins to get data to display the way I need it.

I had been accustomed to seeing \n at the end of many service status lines in the GUI. I no longer see those. Gearman related I think.

I any case, I have modified any scripts that needed update and everything looks good now. That was the last thing I really needed fixed after my upgrade to 5.5.8.

I will say that I appreciate the GUI speed updates when in CCM and updating Services or Hosts. The screen update is immediate versus the 1 or 2 minute wait I used to have. That is nice.

Also, the DB now letting me know who is in the GUI and what they last clicked on is really nice too. The DUO for 2FA is perfect.

Those may be just some minor improvements but they make a big difference to me.

Thanks. All is well... Good job Nagios Team !

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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: multi-line plugin results - only getting the first line

Post by lmiltchev »

It's nice to hear that! :) Thanks for the feedback!

Is it all right if we lock this topic, and mark it as resolved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: multi-line plugin results - only getting the first line

Post by SteveBeauchemin »

close...
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
Locked