[NSClient++] Topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/topic/902
<p>
NSCA nsclient++ issue
</p>
en-usNSClient++/trac/nswide.png
http://nsclient.org/nscp/discussion/topic/902
Trac 1.0beta1 - DiscussionPluginalessandro.brescianiFri, 18 Nov 2011 15:08:51 GMTTopic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/topic/902#topic
http://nsclient.org/nscp/discussion/topic/902#topic
<p>
Hello,
</p>
<p>
from few I am troubling with a communication problem between NSCA on Nagios and nsclient++.
</p>
<p>
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.
</p>
<p>
Here my NSCA conf on the NSCLIENT++:
</p>
<pre class="wiki">[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
</pre><p>
When I start NSCLIENT.exe /test and at the same time I check my syslog on nagios server I get nothing then:
</p>
<pre class="wiki">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...
</pre><p>
It seems that NSCLIENT++ is not passing any packet to the nagios server!!!
</p>
<p>
If I try to send a packet from a linux client from a linux box with the send_nsca everything goes fine:
</p>
<pre class="wiki">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...
</pre><p>
I am really not getting these issue solved any help would really apprecciated.
</p>
<p>
Thanks
Alex
</p>
Topicxavidpr4Wed, 14 Dec 2011 17:00:53 GMTReply #2399 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2399#message2399
http://nsclient.org/nscp/discussion/message/2399#message2399
<p>
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).
</p>
<p>
Anyway i will be researching why it was not working, even i will try to reproduce the error again.
</p>
<p>
Thanks.
Xavi.
</p>
MessagemickemWed, 14 Dec 2011 12:12:00 GMTReply #2398 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2398#message2398
http://nsclient.org/nscp/discussion/message/2398#message2398
<p>
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)...
</p>
<p>
But I had the same problems using send_nsca from 2.7.2 with nsca 2.9 (the unix official versions, not nsclient)
</p>
<p>
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...
</p>
<p>
<em> Michael Medin
</em></p>
Messagexavidpr4Wed, 14 Dec 2011 11:59:02 GMTReply #2397 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2397#message2397
http://nsclient.org/nscp/discussion/message/2397#message2397
<p>
Repeated message. Sorry.
</p>
<p>
Xavi.
</p>
Messagexavidpr4Wed, 14 Dec 2011 11:59:01 GMTReply #2396 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2396#message2396
http://nsclient.org/nscp/discussion/message/2396#message2396
<p>
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?
</p>
<p>
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.
</p>
<p>
Thanks, Xavi.
</p>
Messagexavidpr4Tue, 13 Dec 2011 18:09:45 GMTReply #2393 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2393#message2393
http://nsclient.org/nscp/discussion/message/2393#message2393
<p>
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.
</p>
<p>
This could be interesting: When my nagios server was running with nsca 2.9 I tried that soft (<a class="ext-link" href="http://exchange.nagios.org/directory/Addons/Passive-Checks/NSCA-Win32-Client/details"><span class="icon"></span>http://exchange.nagios.org/directory/Addons/Passive-Checks/NSCA-Win32-Client/details</a>) in the same windows machine that nsclient, and the debug log of nsca in server side was the same when using your agent:
</p>
<pre class="wiki">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)
</pre><p>
I will post tomorrow with some results.
</p>
<p>
Thanks in advance!
</p>
MessagemickemMon, 12 Dec 2011 19:52:14 GMTReply #2391 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2391#message2391
http://nsclient.org/nscp/discussion/message/2391#message2391
<p>
That could actually be it:
</p>
<h3 id="WithNSCA2.7.2serverIget">With NSCA 2.7.2 server I get</h3>
<p>
(My NSCA 2.7 server have been hacked to work actually display errors)
</p>
<p>
echo -e "test\t1\tfoobar" |./nsca-2.9/src/send_nsca -H 192.168.0.1 -c conf
</p>
<pre class="wiki">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...
</pre><p>
echo -e "test\t1\tfoobar" |./nsca-2.7.2/src/send_nsca -H 192.168.0.1 -c conf
</p>
<pre class="wiki">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!
</pre><h3 id="WithNSCA2.9serverIget">With NSCA 2.9 server I get</h3>
<p>
echo -e "test\t1\tfoobar" |./nsca-2.9/src/send_nsca -H 192.168.0.1 -c conf
</p>
<pre class="wiki">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!
</pre><p>
echo -e "test\t1\tfoobar" |./nsca-2.7.2/src/send_nsca -H 192.168.0.1 -c conf
</p>
<pre class="wiki">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...
</pre><p>
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?
</p>
<h3 id="a0.4.0">0.4.0</h3>
<p>
(presumably, havent tried it yet :P)
</p>
<pre class="wiki">[/settings/nsca/client/targets/default]
host=192.168.0.1
password=secret
encryption=none
time offset=-1h
payload length=4096
</pre><h3 id="a0.3.9">0.3.9</h3>
<pre class="wiki">[NSCA Agent]
...
string_length=4096
</pre><p>
But sounds strange, why would they make an non-compatible change?
</p>
<p>
<em> Michael Medin
</em></p>
MessagemickemMon, 12 Dec 2011 19:26:39 GMTReply #2390 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2390#message2390
http://nsclient.org/nscp/discussion/message/2390#message2390
<p>
Uhmm.. have you managed to use any non 2.9 version with 2.9?
</p>
<p>
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 ?
</p>
<p>
But it seems rather strange so hopefully I am missing something?
</p>
<p>
<em> Michael Medin
</em></p>
MessagemickemMon, 12 Dec 2011 18:10:15 GMTReply #2389 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2389#message2389
http://nsclient.org/nscp/discussion/message/2389#message2389
<p>
Interesting...
</p>
<p>
let me check that out... which encryption do you use just 1 or others as well?
</p>
<p>
<em> Michael Medin
</em></p>
Messagexavidpr4Mon, 12 Dec 2011 17:28:25 GMTReply #2388 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2388#message2388
http://nsclient.org/nscp/discussion/message/2388#message2388
<p>
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.
</p>
<p>
Thanks in advance.
</p>
MessagemickemMon, 12 Dec 2011 12:34:03 GMTReply #2386 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2386#message2386
http://nsclient.org/nscp/discussion/message/2386#message2386
<p>
Enable debug in NSCA server it wont tell you any problems otherwise.
Common issues causing "missing data" Are:
</p>
<p>
1, incorrect password/encryption
2, invalid date/time
</p>
<p>
<em> Michael Medin
</em></p>
Messagexavidpr4Fri, 25 Nov 2011 12:29:50 GMTReply #2378 to topic #902 - NSCA nsclient++ issue
http://nsclient.org/nscp/discussion/message/2378#message2378
http://nsclient.org/nscp/discussion/message/2378#message2378
<p>
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.
</p>
<p>
Here my /var/log/messages:
Sent from nagios-nsca server machine:
</p>
<pre class="wiki">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
</pre><p>
Sent from other linux machine:
</p>
<pre class="wiki">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.
</pre><p>
And the events generated with nsclient++
Sent from windows machine:
</p>
<pre class="wiki">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...
</pre><p>
Here is my nsclient++ config:
</p>
<pre class="wiki">
[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
</pre><p>
And nsclient++ /test output
</p>
<pre class="wiki">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...
</pre>
Message