Page 1 of 4

Web UI does not shows multilines in Service Details

Posted: Tue Mar 17, 2015 10:25 am
by guizalan
Hi,

first of all, I'm sorry if I'm posting in the wrong place. I'm new to Nagios.

I'm having dificulties with showing more than one line in STATUS in Service details, as it only shows the first line.

Nagios version 4.0.8
nsclient++ version 0.4.3.131 2015-02-15

The nrpe command works fine when testing on the server, which lists all installed programs:
#################################################
root@nagios:/home/nagios# check_nrpe -H naud12 -c check_windows_app_installs
Program Files Counted: 27
\n
7-Zip9.20(x64edition)
AdobeFlashPlayer16ActiveX
AdobeFlashPlayer16NPAPI
.
.
.
(I'm shortening the list...)
root@nagios:/home/nagios#
#################################################
But when I get to Service Details in WEB UI, it only shows the first line.
Image

What can I do to make the web ui shows the entire list of installed programs?
By the way, the plugin I used is the check_windows_app_installs:
http://exchange.nagios.org/directory/Pl ... ls/details

Re: Web UI does not shows multilines in Service Details

Posted: Tue Mar 17, 2015 3:59 pm
by ssax
The script would need to be modified in order to send all the information clumped together separated by "\n" like in the example below:

http://support.nagios.com/forum/viewtop ... 404#p40404
check_windows_app_installs.zip
(1.22 KiB) Downloaded 212 times
- Let me know if this works for you.

Edit: Fixed minor issue, should work for you now.
Edit 2: Fixed another issue, replacing pipe with : in output to prevent cutoff if your apps have a pipe in the name like mine did.

Re: Web UI does not shows multilines in Service Details

Posted: Wed Mar 18, 2015 2:16 pm
by guizalan
ssax,

thanks for your help.

The command worked on the server, but this time it did not show in the web ui.
nagios@nagios:~$ check_nrpe -H naud12 -c check_windows_app_installs
Program Files Counted: 28\n7-Zip9.20(x64edition)\nAdobeFlashPlayer16ActiveX\nAdobeFlashPlayer16NPAPI\nAdobeReaderXI(11.0.10)-Portugus\nAvastFreeAntivirus\nCaseWareWorkingPapers2014\nFoxitReader\nGoogleChrome\nIntel(R)ProcessorGraphics\nJava8Update31(64-bit)\nMagicISOMakerv5.4(build0239)\nMicrosoft.NETFramework4.5.2\nMicrosoftOfficeHomeandBusiness2013-pt-br\nMicrosoftVisioPremium2010\nMicrosoftVisualC++2005Redistributable\nMicrosoftVisualC++2010x64Redistributable-10.0.40219\nMicrosoftVisualC++2010x86Redistributable-10.0.40219\nMozillaFirefox35.0.1(x86pt-BR)\nMozillaMaintenanceService\nMSXML4.0SP3Parser\nNSClient++(x64)\nPacotedeDriverdoWindows-QualcommAtherosCommunicationsInc.(athr)Ne...\nPacotedeDriverdoWindows-SonyCorporation(SFEP)HIDClass(11/15/2011...\nPDFCreator\nSkypeT7.1\nSNMPInformantAgent(StandardEdition)\nSynapticsPointingDeviceDriver\nVAIOEventService\n
Image

Re: Web UI does not shows multilines in Service Details

Posted: Wed Mar 18, 2015 3:34 pm
by ssax
Did you grab the latest version I posted? Did you force a recheck? It's working properly on mine.

One issue that I found is that NRPE will need to be recompiled/patched to support more than the 1024 limit, you can read more about that here:

http://support.nagios.com/forum/viewtop ... 34&t=25221

Re: Web UI does not shows multilines in Service Details

Posted: Mon Mar 23, 2015 7:35 am
by guizalan
Hi,

sorry for taking too long to answer. I was learning how to compile (configure, make, make install...). And I did it.
I have recompiled nrpe to support 4096, according to the link you sent. But the command works on prompt, but not on web ui.

What I've changed:

Code: Select all

root@nagios:/home/nagios/nrpe-2.15# grep -R 4096
include/common.h:#define MAX_INPUT_BUFFER       4096    /* max size of most buffers we use */
include/common.h:#define MAX_PACKETBUFFER_LENGTH        4096            /* max amount of data we'll send in one query/response */
src/snprintf.c: char buf1[4096];
src/snprintf.c: char buf2[4096];
contrib/nrpe_check_control.c:#define MAX_CHARS  4096
The command is working...

Code: Select all

root@nagios:/home/nagios# check_nrpe -H naud12 -c check_windows_app_installs
Program Files Counted: 28\n7-Zip9.20(x64edition)\nAdobeFlashPlayer16ActiveX\nAdobeFlashPlayer16NPAPI\nAdobeReaderXI(11.0.10)-Portugus\nAvastFreeAntivirus\nCaseWareWorkingPapers2014\nFoxitReader\nGoogleChrome\nIntel(R)ProcessorGraphics\nJava8Update31(64-bit)\nMagicISOMakerv5.4(build0239)\nMicrosoft.NETFramework4.5.2\nMicrosoftOfficeHomeandBusiness2013-pt-br\nMicrosoftVisioPremium2010\nMicrosoftVisualC++2005Redistributable\nMicrosoftVisualC++2010x64Redistributable-10.0.40219\nMicrosoftVisualC++2010x86Redistributable-10.0.40219\nMozillaFirefox35.0.1(x86pt-BR)\nMozillaMaintenanceService\nMSXML4.0SP3Parser\nNSClient++(x64)\nPacotedeDriverdoWindows-QualcommAtherosCommunicationsInc.(athr)Ne...\nPacotedeDriverdoWindows-SonyCorporation(SFEP)HIDClass(11/15/2011...\nPDFCreator\nSkypeT7.1\nSNMPInformantAgent(StandardEdition)\nSynapticsPointingDeviceDriver\nVAIOEventService\n
The error on web ui:
Image
Actually, all my nrpe is working (through shell), but all nrpe shows the same error on webui.

Re: Web UI does not shows multilines in Service Details

Posted: Mon Mar 23, 2015 10:39 am
by jolson
This may have to do with your version of OpenSSL, see this forum post: http://support.nagios.com/forum/viewtop ... 2&start=10

Please try the following on your host machine:

Code: Select all

$(which openssl) version
If it's old, please try an upgrade:

Code: Select all

yum -y install openssl
After the upgrade, be sure to restart NRPE:

Code: Select all

service xinetd restart
Let us know if that helps. Thanks!

Re: Web UI does not shows multilines in Service Details

Posted: Mon Mar 23, 2015 12:42 pm
by guizalan
The openssl seems to be updated:

root@nagios:/home/nagios# $(which openssl) version
OpenSSL 1.0.1f 6 Jan 2014

I've reinstalled through apt-get (apt-get install openssl-I have ubuntu server); But the result was the same version;
Regarding the link you send, I've checked the steps described there, but nothing wrong or new...

I've also set the values back to 1024, and nrpe was back online, but this time nothing is showing in the web ui (before the first line used to show). This happens only for this command, all the others are ok (nrpe-cpu, nrpe-memory, nrpe-other-stuffs):

Code: Select all

root@nagios:/home/nagios/nrpe-2.15# grep -R 1024
include/common.h:#define MAX_INPUT_BUFFER       1024    /* max size of most buffers we use */
include/common.h:#define MAX_PACKETBUFFER_LENGTH        1024            /* max amount of data we'll send in one query/response */
src/snprintf.c: char buf1[1024];
src/snprintf.c: char buf2[1024];
contrib/nrpe_check_control.c:#define MAX_CHARS  1024
Image

And the command is working fine through shell:

Code: Select all

root@nagios:/home/nagios/nrpe-2.15# check_nrpe -H naud12 -c check_windows_app_installs
Program Files Counted: 28\n7-Zip9.20(x64edition)\nAdobeFlashPlayer16ActiveX\nAdobeFlashPlayer16NPAPI\nAdobeReaderXI(11.0.10)-Portugus\nAvastFreeAntivirus\nCaseWareWorkingPapers2014\nFoxitReader\nGoogleChrome\nIntel(R)ProcessorGraphics\nJava8Update31(64-bit)\nMagicISOMakerv5.4(build0239)\nMicrosoft.NETFramework4.5.2\nMicrosoftOfficeHomeandBusiness2013-pt-br\nMicrosoftVisioPremium2010\nMicrosoftVisualC++2005Redistributable\nMicrosoftVisualC++2010x64Redistributable-10.0.40219\nMicrosoftVisualC++2010x86Redistributable-10.0.40219\nMozillaFirefox35.0.1(x86pt-BR)\nMozillaMaintenanceService\nMSXML4.0SP3Parser\nNSClient++(x64)\nPacotedeDriverdoWindows-QualcommAtherosCommunicationsInc.(athr)Ne...\nPacotedeDriverdoWindows-SonyCorporation(SFEP)HIDClass(11/15/2011...\nPDFCreator\nSkypeT7.1\nSNMPInformantAgent(StandardEdition)\nSynapticsPointingDeviceDriver\nVAIOEventService\n
root@nagios:/home/nagios/nrpe-2.15#

Re: Web UI does not shows multilines in Service Details

Posted: Mon Mar 23, 2015 1:08 pm
by ssax
Please try the attached:
check_windows_app_installs.zip
(1.19 KiB) Downloaded 204 times

Re: Web UI does not shows multilines in Service Details

Posted: Mon Mar 23, 2015 1:52 pm
by guizalan
With this new attached,

Now the first line is back. But only the first line. It seems that were are back to square one hehehe.

How the code is responding:

Code: Select all

root@nagios:/home/nagios# check_nrpe -H naud12 -c check_windows_app_installs
Program Files Counted: 28
7-Zip 9.20 (x64 edition)
Adobe Flash Player 16 ActiveX
Adobe Flash Player 16 NPAPI
Adobe Reader XI (11.0.10) - Portugus
Avast Free Antivirus
CaseWare Working Papers 2014
Foxit Reader
Google Chrome
Intel(R) Processor Graphics
Java 8 Update 31 (64-bit)
Magic ISO Maker v5.4 (build 0239)
Microsoft .NET Framework 4.5.2
Microsoft Office Home and Business 2013 - pt-br
Microsoft Visio Premium 2010
Microsoft Visual C++ 2005 Redistributable
Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219
Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219
Mozilla Firefox 35.0.1 (x86 pt-BR)
Mozilla Maintenance Service
MSXML 4.0 SP3 Parser
NSClient++ (x64)
Pacote de Driver do Windows - Qualcomm Atheros Communications Inc. (athr) Ne...
Pacote de Driver do Windows - Sony Corporation (SFEP) HIDClass (11/15/2011 ...
PDFCreator
SkypeT 7.1
SNMP Informant Agent (Standard Edition)
Synaptics Pointing Device Driver
VAIO Event Service
How it shows on the web ui:
Image

Should I try again with the nrpe at 4096?

Re: Web UI does not shows multilines in Service Details

Posted: Mon Mar 23, 2015 2:05 pm
by ssax
No, I believe you will get the CRC error again.

Post the results of the command below:

Code: Select all

grep "Program Files Counted" var/status.dat -A 2
It's working properly for mine, something is different with yours.