NSClient++ Help (#1) - NSCA nsclient++ issue (#902) - Message List
Hello,
from few I am troubling with a communication problem between NSCA on Nagios and nsclient++.
I have installed from source NSCA-2.9 on nagios side and tested with send_nsca from a linux box. Until here everything is fine, but when I try to send checks from a windows machine through Nsclient++ nothing to do. I have tried many different configurations with and without encryption with and without password ect.
Here my NSCA conf on the NSCLIENT++:
[NSCA Agent] ;# CHECK INTERVALL (in seconds) interval=5 ; ;# ENCRYPTION METHOD encryption_method=1 ;# ENCRYPTION PASSWORD ;password= ;# BIND TO ADDRESS bind_to_address=10.0.29.227 ; ;# LOCAL HOST NAME hostname=INFTLC-HDSICOTE ; ;# NAGIOS SERVER ADDRESS nsca_host=10.0.111.235 ; ;# NAGIOS SERVER PORT nsca_port=567 [NSCA Commands] my_cpu_check=checkCPU warn=80 crit=90 time=20m time=10s time=4
When I start NSCLIENT.exe /test and at the same time I check my syslog on nagios server I get nothing then:
Nov 18 15:51:04 cgmon03rsicote nsca[28740]: Handling the connection... Nov 18 15:51:04 cgmon03rsicote nsca[28740]: End of connection... Nov 18 15:51:09 cgmon03rsicote nsca[28740]: Connection from 10.0.29.227 port 40798 Nov 18 15:51:09 cgmon03rsicote nsca[28740]: Handling the connection... Nov 18 15:51:10 cgmon03rsicote nsca[28740]: End of connection... Nov 18 15:51:14 cgmon03rsicote nsca[28740]: Connection from 10.0.29.227 port 41054 Nov 18 15:51:14 cgmon03rsicote nsca[28740]: Handling the connection... Nov 18 15:51:14 cgmon03rsicote nsca[28740]: End of connection...
It seems that NSCLIENT++ is not passing any packet to the nagios server!!!
If I try to send a packet from a linux client from a linux box with the send_nsca everything goes fine:
Nov 18 16:06:52 cgmon03rsicote nsca[28740]: Connection from 10.0.29.157 port 23176 Nov 18 16:06:52 cgmon03rsicote nsca[28740]: Handling the connection... Nov 18 16:06:53 cgmon03rsicote nsca[28740]: SERVICE CHECK -> Host Name: 'pincopallo', Service Description: 'CPU Load', Return Code: '0', Output: 'OK CPU LOAD ok' Nov 18 16:06:53 cgmon03rsicote nsca[28740]: Attempting to write to nagios command pipe Nov 18 16:06:53 cgmon03rsicote nsca[28740]: End of connection...
I am really not getting these issue solved any help would really apprecciated.
Thanks Alex
-
Message #2378
Same problem here!!!, even the same message in /var/log/messages in my nsca-nagios server. In my case i have configured nsca to work with xinetd, so that is the reason of my xinetd logs. I have installed NSCA-2.9 too.
Here my /var/log/messages: Sent from nagios-nsca server machine:
Nov 24 15:54:43 nagios1mad xinetd[1401]: START: nsca pid=8732 from=::ffff:127.0.0.1 Nov 24 15:54:43 nagios1mad nsca[8732]: Handling the connection... Nov 24 15:54:44 nagios1mad nsca[8732]: SERVICE CHECK -> Host Name: 'MAD_YUS_CPH3_NEW', Service Description: 'hihere', Return Code: '3', Output: 'a ver si funciona de una vez' Nov 24 15:54:44 nagios1mad nsca[8732]: Attempting to write to nagios command pipe Nov 24 15:54:44 nagios1mad nsca[8732]: End of connection... Nov 24 15:54:44 nagios1mad xinetd[1401]: EXIT: nsca status=0 pid=8732 duration=1(sec) Nov 24 15:54:44 nagios1mad nagios: EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;MAD_YUS_CPH3_NEW;hihere;3;a ver si funciona de una vez Nov 24 15:54:48 nagios1mad nagios: PASSIVE SERVICE CHECK: MAD_YUS_CPH3_NEW;hihere;3;a ver si funciona de una vez Nov 24 15:54:48 nagios1mad nagios: SERVICE NOTIFICATION: nagiosadmin;MAD_YUS_CPH3_NEW;hihere;UNKNOWN;notify-service-by-email;a ver si funciona de una vez
Sent from other linux machine:
Nov 25 10:30:16 nagios1mad xinetd[1401]: START: nsca pid=22811 from=::ffff:10.197.74.18 Nov 25 10:30:16 nagios1mad nsca[22811]: Handling the connection... Nov 25 10:30:17 nagios1mad nsca[22811]: SERVICE CHECK -> Host Name: 'BCN_STB_FIC2', Service Description: 'my_cpu_check', Return Code: '1', Output: 'Al loro que no estamos tan mal!' Nov 25 10:30:17 nagios1mad nsca[22811]: Attempting to write to nagios command pipe Nov 25 10:30:17 nagios1mad nsca[22811]: End of connection... Nov 25 10:30:17 nagios1mad xinetd[1401]: EXIT: nsca status=0 pid=22811 duration=1(sec) Nov 25 10:30:17 nagios1mad nagios: EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;BCN_STB_FIC2;my_cpu_check;1;Al loro que no estamos tan mal! Nov 25 10:30:24 nagios1mad nagios: PASSIVE SERVICE CHECK: BCN_STB_FIC2;my_cpu_check;1;Al loro que no estamos tan mal! Nov 25 10:30:24 nagios1mad nagios: SERVICE ALERT: BCN_STB_FIC2;my_cpu_check;WARNING;HARD;1;Al loro que no estamos tan mal! All them were sent with send_nsca provided in the nsca-2.9 package.
And the events generated with nsclient++ Sent from windows machine:
Nov 25 11:19:28 nagios1mad xinetd[1401]: START: nsca pid=23521 from=::ffff:10.197.64.71 Nov 25 11:19:28 nagios1mad nsca[23521]: Handling the connection... Nov 25 11:19:29 nagios1mad nsca[23521]: End of connection... Nov 25 11:19:29 nagios1mad xinetd[1401]: EXIT: nsca status=0 pid=23521 duration=1(sec) Nov 25 11:19:38 nagios1mad xinetd[1401]: START: nsca pid=23522 from=::ffff:10.197.64.71 Nov 25 11:19:38 nagios1mad nsca[23522]: Handling the connection... Nov 25 11:19:39 nagios1mad nsca[23522]: End of connection... Nov 25 11:19:39 nagios1mad xinetd[1401]: EXIT: nsca status=0 pid=23522 duration=1(sec) Nov 25 11:19:48 nagios1mad xinetd[1401]: START: nsca pid=23523 from=::ffff:10.197.64.71 Nov 25 11:19:48 nagios1mad nsca[23523]: Handling the connection... Nov 25 11:19:49 nagios1mad nsca[23523]: End of connection... Nov 25 11:19:49 nagios1mad xinetd[1401]: EXIT: nsca status=0 pid=23523 duration=1(sec) Nov 25 11:19:58 nagios1mad xinetd[1401]: START: nsca pid=23527 from=::ffff:10.197.64.71 Nov 25 11:19:58 nagios1mad nsca[23527]: Handling the connection... Nov 25 11:19:59 nagios1mad nsca[23527]: End of connection...
Here is my nsclient++ config:
[NSCA Agent] interval=10 encryption_method=1 password=pwd hostname=BCN_STB_FIC2 nsca_host=10.197.48.65 [NSCA Commands] my_cpu_check=checkCPU warn=80 crit=90 time=20m time=10s time=4 my_mem_check=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=page host_check=check_ok
And nsclient++ /test output
d \NSCAThread.cpp(206) Executing (from NSCA): d NSClient++.cpp(1144) Injecting: check_ok: d NSClient++.cpp(1144) Injecting: CheckOK: Everything, is, fine! d NSClient++.cpp(1180) Injected Result: OK 'Everythingisfine!' d NSClient++.cpp(1181) Injected Performance Result: '' d NSClient++.cpp(1180) Injected Result: OK 'Everythingisfine!' d NSClient++.cpp(1181) Injected Performance Result: '' d \NSCAThread.cpp(206) Executing (from NSCA): my_cpu_check d NSClient++.cpp(1144) Injecting: checkCPU: warn=80, crit=90, time=20m, time=10s , time=4 d NSClient++.cpp(1180) Injected Result: OK 'OK CPU Load ok.' d NSClient++.cpp(1181) Injected Performance Result: ''20m'=0%;80;90 '10s'=0%;80; 90 '4'=0%;80;90' d \NSCAThread.cpp(206) Executing (from NSCA): my_mem_check d NSClient++.cpp(1144) Injecting: checkMem: MaxWarn=80%, MaxCrit=90%, ShowAll, t ype=page d NSClient++.cpp(1180) Injected Result: OK 'OK: page file: 343M' d NSClient++.cpp(1181) Injected Performance Result: ''page file %'=8%;80;90 'pag e file'=343.3MB;3100.66;3488.24;0;3875.82' d \NSCAThread.cpp(272) Sending to server... d \NSCAThread.cpp(279) Looked up 10.197.48.65 to 10.197.48.65 d \NSCAThread.cpp(356) Finnished sending to server...
xavidpr411/25/11 13:29:50 (19 months ago)-
Message #2386
Enable debug in NSCA server it wont tell you any problems otherwise. Common issues causing "missing data" Are:
1, incorrect password/encryption 2, invalid date/time
Michael Medin
mickem12/12/11 13:34:03 (19 months ago)-
Message #2388
The debug option in nsca.cfg was enabled since the beginning. I think that there is some issue with nsca 2.9 - nsclient v0.3.9 because i finally get tired to try it work and installed nsca v2.7 which magically worked very well. Please check it when you can.
Thanks in advance.
xavidpr412/12/11 18:28:25 (19 months ago)-
Message #2389
Interesting...
let me check that out... which encryption do you use just 1 or others as well?
Michael Medin
mickem12/12/11 19:10:15 (19 months ago) -
Message #2390
Uhmm.. have you managed to use any non 2.9 version with 2.9?
I just looked briefly so I am unsure... Seems they changed the protocol in 2.9 to support more data but not in a backwards compatible way(?) which would mean 2.9 would not be compatible with anything ?
But it seems rather strange so hopefully I am missing something?
Michael Medin
mickem12/12/11 20:26:39 (19 months ago)-
Message #2391
That could actually be it:
With NSCA 2.7.2 server I get
(My NSCA 2.7 server have been hacked to work actually display errors)
echo -e "test\t1\tfoobar" |./nsca-2.9/src/send_nsca -H 192.168.0.1 -c conf
Dec 12 20:40:20 localhost nsca[27859]: Connection from 192.168.0.1 port 10138 Dec 12 20:40:20 localhost nsca[27859]: Handling the connection... Dec 12 20:40:20 localhost nsca[27859]: Dropping packet with invalid CRC32 (da5718b4 != a99801c9)- possibly due to client using wrong password or crypto algorithm? Dec 12 20:40:20 localhost nsca[27859]: End of connection...
echo -e "test\t1\tfoobar" |./nsca-2.7.2/src/send_nsca -H 192.168.0.1 -c conf
Dec 12 20:40:58 localhost nsca[27859]: Connection from 192.168.0.1 port 29594 Dec 12 20:40:58 localhost nsca[27859]: Handling the connection... Dec 12 20:40:58 localhost nsca[27859]: HOST CHECK -> Host Name: 'test', Return Code: '1', Output: 'foobar' Dec 12 20:40:58 localhost nsca[27859]: End of connection... Dec 12 20:40:58 localhost nagios3: Warning: Passive check result was received for host 'test', but the host could not be found!
With NSCA 2.9 server I get
echo -e "test\t1\tfoobar" |./nsca-2.9/src/send_nsca -H 192.168.0.1 -c conf
Dec 12 20:44:56 localhost nsca[6769]: Connection from 192.168.0.1 port 27603 Dec 12 20:44:56 localhost nsca[6769]: Handling the connection... Dec 12 20:44:56 localhost nsca[6769]: HOST CHECK -> Host Name: 'test', Return Code: '1', Output: 'foobar' Dec 12 20:44:56 localhost nsca[6769]: Attempting to write to nagios command pipe Dec 12 20:44:56 localhost nsca[6769]: End of connection... Dec 12 20:44:56 localhost nagios3: Warning: Passive check result was received for host 'test', but the host could not be found!
echo -e "test\t1\tfoobar" |./nsca-2.7.2/src/send_nsca -H 192.168.0.1 -c conf
Dec 12 20:44:47 localhost nagios3: Auto-save of retention data completed successfully. Dec 12 20:44:47 localhost nsca[6769]: Connection from 192.168.0.1 port 27347 Dec 12 20:44:47 localhost nsca[6769]: Handling the connection... Dec 12 20:44:47 localhost nsca[6769]: End of connection...
Fortunetly with NSCLient++ (0.4.0 and possible 0.3.x as well) you can configure the datalength which seems to be the difference, so presumably setting payload length to 4096 would make it magically work again?
0.4.0
(presumably, havent tried it yet :P)
[/settings/nsca/client/targets/default] host=192.168.0.1 password=secret encryption=none time offset=-1h payload length=4096
0.3.9
[NSCA Agent] ... string_length=4096
But sounds strange, why would they make an non-compatible change?
Michael Medin
mickem12/12/11 20:52:14 (19 months ago)-
Message #2393
Ups sorry for answering so late. Let me try it tomorrow again please By the way, I was using encryption=1 in both sides, with and without password. Even I remember that I made some test with no encryption.
This could be interesting: When my nagios server was running with nsca 2.9 I tried that soft (http://exchange.nagios.org/directory/Addons/Passive-Checks/NSCA-Win32-Client/details) in the same windows machine that nsclient, and the debug log of nsca in server side was the same when using your agent:
Nov 25 11:19:28 nagios1mad xinetd[1401]: START: nsca pid=23521 from=::ffff:10.197.64.71 Nov 25 11:19:28 nagios1mad nsca[23521]: Handling the connection... Nov 25 11:19:29 nagios1mad nsca[23521]: End of connection... Nov 25 11:19:29 nagios1mad xinetd[1401]: EXIT: nsca status=0 pid=23521 duration=1(sec)
I will post tomorrow with some results.
Thanks in advance!
xavidpr412/13/11 19:09:45 (18 months ago) -
Message #2396
So you say that when it is sent with non v2.9 send_nsca to v2.9 nsca server it's not compatible, is it?
Still not made the test with v2.9 (my new nagios it's already under production with nsca 2.7.2), but I remember perfectly that every nsca message send from a linux host (local and remote hosts) was recived properly by nsca server and SERVICE_CHECK launched. And then nagios engine read and posted the output in frontend (see my first post - linux output). Unfortunately i don't remember if i was using v2.9 send_nsca, but it only failed when sent from windows host with your nsclient and with the port of send_nsca for win32 too.
Thanks, Xavi.
xavidpr412/14/11 12:59:01 (18 months ago)-
Message #2398
Thats my observation yes... But as I said seems rather strange to do "non compatible changes" going from 2.7.2 -> 2.9 (then it should have been 3.0 I would have assumed)...
But I had the same problems using send_nsca from 2.7.2 with nsca 2.9 (the unix official versions, not nsclient)
But check the nsca server version, iof that is 2.9 then you need to change the payload size to 4096 like I explained above and I think it should work...
Michael Medin
mickem12/14/11 13:12:00 (18 months ago)-
Message #2399
Hi Mickem, since last days of november i'm using icinga with nsca 2.7.2 working well for 30 host more or less. And 1 hour ago, that I recompiled nsca 2.9 and installed over v2.7.2 without changing any config file and !!it's working well!!. I don't know why, but I'm almost sure that i did not have any error in my config files when I was trying to do it work by the time of my first post (remember that I achieved recive passive notifications but only from linux host).
Anyway i will be researching why it was not working, even i will try to reproduce the error again.
Thanks. Xavi.
xavidpr412/14/11 18:00:53 (18 months ago)
-
-
-
Message #2397
Repeated message. Sorry.
Xavi.
xavidpr412/14/11 12:59:02 (18 months ago)
-
-
-
-
-








