NSClient++ Help (#1) - Logs pretty much explain themselve but cannot find anything on that (#88) - Message List
2008-02-06 11:19:01: debug:.\PDHCollector.cpp:102: Using index to retrive counternames
2008-02-06 11:19:01: debug:.\NSClient++.cpp:382: Loading plugin: NRPE server...
2008-02-06 11:19:02: debug:.\PDHCollector.cpp:122: Found countername: CPU: \Processor(_total)\% Processor Time
2008-02-06 11:19:02: debug:.\PDHCollector.cpp:123: Found countername: UPTIME: \System\System Up Time
2008-02-06 11:19:02: debug:.\NSClient++.cpp:382: Loading plugin: NSCAAgent...
2008-02-06 11:19:02: error:d:\Documents and Settings\mickem\Mina dokument\Visual Studio 2005\Projects\NSCP\trunk\include\Socket.h:583: bind failed: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2008-02-06 11:19:02: debug:.\PDHCollector.cpp:124: Found countername: MCL: \Memory\Commit Limit
2008-02-06 11:19:02: debug:.\NSClient++.cpp:382: Loading plugin: NSClient server...
2008-02-06 11:19:02: error:d:\Documents and Settings\mickem\Mina dokument\Visual Studio 2005\Projects\NSCP\trunk\include\Socket.h:606: Socket did not start properly, we will now do nothing...
2008-02-06 11:19:02: debug:.\PDHCollector.cpp:125: Found countername: MCB: \Memory\Committed Bytes
2008-02-06 11:19:02: debug:.\NSClient++.cpp:382: Loading plugin: SystemTray...
2008-02-06 11:19:02: debug:d:\Documents and Settings\mickem\Mina dokument\Visual Studio 2005\Projects\NSCP\trunk\include\Socket.h:575: Bound to: 0.0.0.0:12489
2008-02-06 11:19:02: error:.\SysTray.cpp:40: SysTray is not installed (or it cannot interact with the desktop) SysTray wont be loaded. Run NSClient++ SysTray install ti change this.
2008-02-06 11:19:02: debug:.\NSClient++.cpp:289: Found module: SystemTray...
2008-02-06 11:19:03: message:.\SysTray.cpp:63: SystemTray is now able to run as the SERVICE_INTERACTIVE_PROCESS flag has been set.
2008-02-06 11:19:29: debug:.\NSClient++.cpp:382: Loading plugin: NRPE server...
2008-02-06 11:19:29: debug:.\PDHCollector.cpp:122: Found countername: CPU: \Processor(_total)\% Processor Time
2008-02-06 11:19:29: debug:.\PDHCollector.cpp:123: Found countername: UPTIME: \System\System Up Time
2008-02-06 11:19:29: debug:.\PDHCollector.cpp:124: Found countername: MCL: \Memory\Commit Limit
2008-02-06 11:19:29: debug:.\PDHCollector.cpp:125: Found countername: MCB: \Memory\Committed Bytes
2008-02-06 11:19:30: debug:.\NSClient++.cpp:382: Loading plugin: NSCAAgent...
2008-02-06 11:19:30: error:d:\Documents and Settings\mickem\Mina dokument\Visual Studio 2005\Projects\NSCP\trunk\include\Socket.h:583: bind failed: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2008-02-06 11:19:30: error:d:\Documents and Settings\mickem\Mina dokument\Visual Studio 2005\Projects\NSCP\trunk\include\Socket.h:606: Socket did not start properly, we will now do nothing...
2008-02-06 11:19:30: debug:.\NSClient++.cpp:382: Loading plugin: NSClient server...
2008-02-06 11:19:30: debug:.\NSClient++.cpp:382: Loading plugin: SystemTray...
2008-02-06 11:19:30: debug:d:\Documents and Settings\mickem\Mina dokument\Visual Studio 2005\Projects\NSCP\trunk\include\Socket.h:575: Bound to: 0.0.0.0:12489
2008-02-06 11:20:30: debug:.\NSClient++.cpp:480: Injecting: checkCPU: warn=80, crit=90, time=20m, time=10s, time=4
2008-02-06 11:20:30: debug:.\NSClient++.cpp:500: Injected Result: OK 'OK CPU Load ok.'
2008-02-06 11:20:30: debug:.\NSClient++.cpp:501: Injected Performance Result: 20m'=0;80;90; '10s'=8;80;90; '4'=3;80;90; '
2008-02-06 11:20:30: message:.\NSCAThread.cpp:58: Result: service: , code: 0, time: 2008-02-06 16:20:30, result: OK CPU Load ok.|'20m'=0;80;90; '10s'=8;80;90; '4'=3;80;90;
2008-02-06 11:20:30: debug:.\NSClient++.cpp:480: Injecting: checkMem: MaxWarn=80%, MaxCrit=90%, ShowAll, type=page
2008-02-06 11:20:30: debug:.\CheckSystem.cpp:722: Perf data: 1:'page file'=21%;80;90;
2008-02-06 11:20:30: debug:.\NSClient++.cpp:500: Injected Result: OK 'OK: page file: 269M'
2008-02-06 11:20:30: debug:.\NSClient++.cpp:501: Injected Performance Result: page file'=21%;80;90; '
2008-02-06 11:20:30: message:.\NSCAThread.cpp:58: Result: service: , code: 0, time: 2008-02-06 16:20:30, result: OK: page file: 269M|'page file'=21%;80;90;
2008-02-06 11:20:30: debug:.\NSClient++.cpp:480: Injecting: checkServiceState: CheckAll?, exclude=wampmysqld, exclude=MpfService?
2008-02-06 11:20:30: debug:.\NSClient++.cpp:500: Injected Result: CRITICAL 'CRITICAL: Browser: stopped (critical), srservice: stopped (critical)'
2008-02-06 11:20:30: debug:.\NSClient++.cpp:501: Injected Performance Result:
2008-02-06 11:20:30: message:.\NSCAThread.cpp:58: Result: service: , code: 2, time: 2008-02-06 16:20:30, result: CRITICAL: Browser: stopped (critical), srservice: stopped (critical)|
2008-02-06 11:20:30: error:.\NSCAThread.cpp:140: <<< Failed to read header: 131.211.47.2505667
I do not understand why it goes on a drive that doesn't exist, why it try to bind something to socket.h in that folder. Right now, my nagios is working fine and waiting for the passive checks of this remote host. But it doesn't want to send the info. I have read carefuly the readme and all the stuff about it. But can't get it to work. I just tried stop the NRPE, I got one step further but receive again that weird d: drive access and the failed to read header. If somebody could help, I would really enjoy. This is really not something easy for me to figure out. Thanks
-
Message #212
First off the binding: nsclient++ is multitasking so I would guess it is actuall
2008-02-06 11:19:01: debug:.\NSClient++.cpp:382: Loading plugin: NRPE server...
that does the binding, try to disable the NRPE module.
As for the "Failed to read header:..." it seems to be related to the NSCA server responding "badly" what version of NSCA (nagios-side) do you use?
MickeM
anonymous02/07/08 08:59:04 (4 years ago)-
Message #218
NSCA - Nagios Service Check Acceptor
Copyright (c) 2000-2007 Ethan Galstad (www.nagios.org)
Version: 2.7.2
Last Modified: 07-03-2007
License: GPL v2
Encryption Routines: AVAILABLE
That is the information of the nsca executable I found by running the -v function.
Boomy02/08/08 15:16:12 (4 years ago) -
Message #219
NSCA - Nagios Service Check Acceptor
Copyright (c) 2000-2007 Ethan Galstad (www.nagios.org)
Version: 2.7.2
Last Modified: 07-03-2007
License: GPL v2
Encryption Routines: AVAILABLE
That is the information of the nsca executable I found by running the -v function.
Boomy02/08/08 15:27:50 (4 years ago)-
Message #220
My test-box has 2.6 I shall try with 2.7...
MickeM
anonymous02/08/08 16:35:02 (4 years ago)-
Message #221
I have another info to add. I got the message Auto-save of retention data completed successfully. in the nagios.log happening about every two minutes (my current setting of my nsca on the remote host).
Boomy02/08/08 16:46:27 (4 years ago) -
Message #222
Alright, I have installed nsca on another remote PC, with Linux this time and when trying to connect to the server, got those 2 errors:
Error: Server closed connection before init packet was received Error: Could not read init packet from server
I have allowed the address to connect in the etc/xinet.d/nsca file... I tried both with encryption and without...
Then I restarted the computer... you know, just in case... It start to work for my linux PC. (clean reatart should always be the first solution) lol!
Then I tried with the NsClient?++. It send the data to the server, but something is wrong. The ipaddress is the one of the server instead of the one of my windows host. So when nagios check, it's the wrong host, it will always be the same host (in this case the server). Just looked in the syslog of nagios... and i don't see how to manage this one... But I'll continue to work it out. If somebody knows, just let me know. Thanks
Boomy02/08/08 21:12:32 (4 years ago)-
Message #224
I am not sure I understand...
NSCA is a passive system, ie. the client (windows machine) sends data to the server (linux/nagios). So the ip-address "should" be the server as it is the server who do not "respond well" (according to "nsclient++").
But do you still get the same error, it seemd the linux client had the same problem "nsclient++"?
MickeM
mickem02/09/08 09:36:47 (4 years ago)
-
-
Message #223
I've try many things now, and I realise that it is impossible to run the cscript.exe in the nsca command. It should be possible since it is for the NRPE. I really need it since it would run my script I've modify. The script is in .wsf format. Which actually run with NRPE_NT, which I've use a little but it doesn't meet my needs since I need passive check from nagios and not active. The ip address is still not working... version I have is 2008-02-04
Thanks in advance, and if it is not too much, I would like to know if the source could be available?
Thanks again
Boomy02/08/08 22:26:01 (4 years ago)-
Message #225
If you click "browse source" you can get see the source or if you prefer you can grab it via subversion:
svn co http://svn.nakednuns.org/nscp/
For details on how to build check the build-page (notice nsclient++ has some dependencies so it is not a point-n-click operation to build, but it is fairly straight forward to set things up)
MickeM
mickem02/09/08 10:06:11 (4 years ago) -
Message #226
now to answer your second question. To run external commands you need to "handle external commands", the "NSCA handlers" are just internal commands. But there are several ways to "wrap" external commands and run them from NSCA: 1, the NRPE module has a command handler that does just that. 2, the LUA script module could do that. 3, the NEW CheckExternalScripts is designed for just that, it is similar to NRPE in that regard but lacks the NRPE "listener" so you don't need the extra "stuff" (and potential security issues) so I would recommend that as a solution for you. But it is an early beta (just out in the latest nightly build :) so might wanna experiment and see that it works before you start using it in a production environment :)
MickeM
mickem02/09/08 11:52:14 (4 years ago)-
Message #230
I think I need to clarify. I am presently running nagios on a virtual server. Nagios is presently checking for the remote host updates with NRPE. Most of the computer fails to return answer because it is always timeout. Because of this, nagios is losing precious time (parallel check not allowed to reduce system load). So, there came my idea of NSCA. With this, I could run my script (on the remote host) to check the updates of the remote host and then send the data collected to nagios. If the remote host is unavailable, I have another service that check that. So I don't get to do any service dependancies, and I don't need to change the notification in a impossible way. That is why NSCA is what I need. That is what I found out.
To review where I am right now:
[1202917313] EXTERNAL COMMAND: PROCESS_HOST_CHECK_RESULT;138.214.49.245;0;OK CPU Load ok.|'20m'=2;80;90; '10s'=1;80;90; '4'=1;80;90;
[1202917313] Warning: Passive check result was received for host '138.214.49.245', but the host could not be found!
[1202917313] EXTERNAL COMMAND: PROCESS_HOST_CHECK_RESULT;138.214.49.245;768;Command was not found: cscript.exe
This is the check received from a remote host (this is the nagios.log). This ipaddress is used to check for which host is the information. So, if I have 25 computers that check the updates, I will receive 25 different information that will all be directed to the same host, the server. To make it work, I would have to create 25 different services on the nagios server, each of them with a different name. All the remote host would have to have different configuration. This is why the ipaddress should be the one of the remote host and not the one of the server. I made it work on linux because I could specify the server address, and then specify the ipaddress of the remote host so that nagios received info of the remote host and identified it as the remote host (not the server). If you don't see what I mean, just tell me, I will try to be more clear. English is not my mother tong.
What I have try to run as a command is this: my_windows_updates_check=cscript.exe NoLogo T:120 scripts\check_windows_updates.wsf /w:1 /c:3 Which I saw in the sample provided, but doesn't seem to understand the cscript.exe command.
To review:
- The remote host send the data to the server
- The server accept incoming information from remote host
- The server will not process the info since it is the wrong ip address (it is the one of the server instead of the remote host)
- The csript.exe is not known by nsclient++
I think it is more clear now, and I am sure you will understand well this time. Sorry for the previous replies that were not enough clear.
Thanks again for your time.
Boomy02/13/08 17:15:21 (4 years ago)-
Message #231
sorry... I must have been braindead when I wrote that function...
Anyways added a new option hostname that is the name of the host (if it is not set the "computer-name" will be used instead.
hope this makes the NSCA thingy usable at least :)
I have never used NSCA myself so I have to admit I dont really know how to use it, so if there i anything else "strange" "wrong" or what not not, dont hesitate to let me know.
As for the cscript it "should" I shall look into a it a bit more but there is a sample command (in the NRPE section) that use it and it works like a charm:
check_vbs=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs
So what you need to do is:
[modules] NSCAAgent.dll CheckExternalScripts.dll ... [External Scripts] my_external_vbs=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs ... [NSCA Commands] my_nsca_check=my_external_check ...
it is also possible to do the same with NRPE module (as it can also execute external scripts)
MickeM
mickem02/13/08 23:09:25 (4 years ago)-
Message #236
I have an update. I have installed the last build 200802191842 on my remote host. It is very nice that the hostname was implemented (thanks MickeM). Now, the server receives no information at all. Tried inversing the two and I got nothing also (just in case). I send you some log even though I think it won't be useful. My linux PC is enable to send passive check easily by running a certain command. It's probably just the link between the remote host and the server that is not fine, but it was wrking with the previous build I had, before the hostname was implemented. Thanks a lot for working on this!
2008-02-19 16:05:39: debug:.\NSClientListener.cpp:143: Data: None&4&c
2008-02-19 16:05:39: debug:.\NSClientListener.cpp:168: Data: c
2008-02-19 16:05:39: debug:.\NSClient++.cpp:507: Injecting: CheckDriveSize: c, nsclient
2008-02-19 16:05:39: debug:.\NSClient++.cpp:527: Injected Result: OK '5283495936&8578932736'
2008-02-19 16:05:39: debug:.\NSClient++.cpp:528: Injected Performance Result:
Boomy02/19/08 22:28:35 (4 years ago)-
Message #237
what encryption settings do you have on both hosts?
i.e.
encryption_method=? (has to be same, and a supported encryption)
also check the syslog of the "NSCA-server host" usually says something semi-useful...
the log above seems to be related to NSClientListener (which should not be involved at all if you use NSCA?)
MickeM
anonymous02/19/08 22:59:42 (4 years ago) -
Message #238
sorry... managed to break stuff, try the latest nightly... MickeM
mickem02/20/08 21:07:54 (4 years ago)-
Message #239
It's WORKING! (thanks mickem) Well, at least small command like check_cpu. I can now see my error for the csript. Im running this command in the nsca commands: windows_updates=cscript.exe -NoLogo? -T:120 scripts/check_windows_updates.wsf /w:1 /c:3 and I get this: 2008-02-21 09:58:41: debug:.\NSClient++.cpp:513: Injecting: cscript.exe: -NoLogo?, -T:120, scripts/check_windows_updates.wsf, /w:1, /c:3
2008-02-21 09:58:41: message:.\NSClient++.cpp:548: No handler for command: 'cscript.exe'
2008-02-21 09:58:41: message:..\..\include\NSCHelper.cpp:223: No handler for command 'cscript.exe'.
I read how you explain me before but I don't understand. Can I use .wsf script? But I think my error remain with the fact that the cscript is not handle. In nagios, it says Command was not found: csript.exe. I have enable the CheckExternalScript?.dll. I very appreciate the help you have given me since the beginning. Thnaks a lot!
Boomy02/21/08 16:29:21 (4 years ago)-
Message #240
you need to "loop" the scripts as a command (with the CheckExternlScripts? module)
Th CES module will make a "command" oif you script, and NSCA can then "run the command" and submit the data.
I can get back with details later, need to run off now... but if you look in the sample nsc.ini you might get some hints...
MickeM
anonymous02/21/08 16:41:42 (4 years ago)-
Message #241
Thanks a lot, its almost running perfectly! When nagios receive the information about my external script, it receives 256 for warnings and 512 for critical, when it should be 1 and 2, 3 for unknown. My script is up to that standard, the nsclient logs seems also to understand it since it shows a warning when it is supose to be a warning. But I can't understand why the server receive 256 and 512. The following are nagios logs and as you can see, it shows a 256 for a warning, then transfert it to 3 since it is unknown.
[1203612039] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;000.000.000.000;windows_updates;256;Number of critical updates not installed: 1 <br />Number of software updates not installed: 4 <br /> Critical updates name Microsoft .NET Framework 2.0 Service Pack 1 (KB110806)+|
[1203612039] SERVICE ALERT: 000.000.000.000;windows_updates;UNKNOWN;SOFT;3;Number of critical updates not installed: 1 <br />Number of software updates not installed: 4 <br /> Critical updates name Microsoft .NET Framework 2.0 Service Pack 1 (KB110806)+
hidden ipaddress for security purpose. The following are the remote host logs:
2008-02-21 11:45:15: debug:.\NSClient++.cpp:513: Injecting: checkCPU: warn=80, crit=90, time=20m, time=10s, time=4
2008-02-21 11:45:15: debug:.\NSClient++.cpp:533: Injected Result: OK 'OK CPU Load ok.'
2008-02-21 11:45:15: debug:.\NSClient++.cpp:534: Injected Performance Result: 20m'=3;80;90; '10s'=1;80;90; '4'=3;80;90; '
2008-02-21 11:45:15: debug:.\NSClient++.cpp:513: Injecting: windows_updates_script:
2008-02-21 11:45:53: debug:.\NSClient++.cpp:533: Injected Result: WARNING 'Number of critical updates not installed: 1 <br />Number of software updates not installed: 4 <br /> Critical updates name Microsoft .NET Framework 2.0 Service Pack 1 (KB110806)+'
2008-02-21 11:45:53: debug:.\NSClient++.cpp:534: Injected Performance Result:
Thanks again for all the work you have done so far.
Boomy02/21/08 17:52:54 (4 years ago)-
Message #243
new nightly, fixes this issue (i hope)... (and the reason is silly, if you look at 256 as hex you get 100, and 512 as hex is 300 etc, I forgot to convert to network orderd bytes :)
MickeM
mickem02/22/08 07:49:45 (4 years ago)-
Message #246
Thanks to be working on this so often. I am sorry to tell you that the last change didn't work. I am still getting unknown errors instead of warning or critical... I will go check into my script to see if there is a problem, but last time I checked, I was returning 0, 1 and 2 for OK, WARNING, CRITICAL. and 3 was for UNKNOWN, and any higher than that were set to UNKNOWN. The following code are a exemple of how I have done my script. Has you can see, the return value comes from the wscript.quit() function. This script was working fine with nrpe.
If intUncompleted > 0 Then
WScript.Echo "Number of critical updates not installed: " & intUncompleted & " <br />" & "Number of software updates not installed: " & intUncompletedSoftware & " <br /> " & " Critical updates name: " & updatesNames
If intUncompleted > intCriticLvl Then
Wscript.Quit(intCritical)
End If
PS: intCritical = 2
Like I said before, the logs of the NSClient++ showed Warning and critical. But nagios never received the Warning or Critical since it receive a 256 or 512 instead.
I am trying to give the best information I can, I know what it must be like trying to find a error like that. Thanks a lot for working on this. I appreciate so much. Thanks
Boomy02/25/08 20:02:12 (4 years ago)-
Message #247
not sure I will be able to "fix this before next week, but anyways, could you attach:
- your config file (feel free to remove any passwords and such)
- the script (feel free to remove anything but the exit code)
- the log from "nsclient++ /test"
- the syslog entries from the NSCA server (preferably with debug set to true)
But you can start with what build of nsclient++ you have.
MickeM
anonymous02/26/08 08:21:43 (4 years ago)-
Message #255
The script I have worked with is not online at http://www.nagiosexchange.org/Windows_NRPE.66.0.html?&tx_netnagext_pi1[p_view]=1250&tx_netnagext_pi1[page]=30%3A10
where can i get the syslog of the NSCA server since it does not sounds like the logs of nagios?
for the other information, I will need your email address to be able to send it to you.
Thanks
Boomy02/28/08 15:42:39 (4 years ago)
-
-
-
-
-
-
-
-
-
-
-
-
-







