Re: Nagios and off site Windows monitoring
Posted: Wed Jul 29, 2015 3:35 pm
The last nsclient.ini in the thread didn't include anything to setup the passive check. Did you implement that? If so can we take a look at it?
Support for Nagios products and services
https://support.nagios.com/forum/
Code: Select all
tcp 0 0 0.0.0.0:5667 0.0.0.0:* LISTEN 1745/nscaDo you mean something like this? I just added after your message.jdalrymple wrote:The last nsclient.ini in the thread didn't include anything to setup the passive check. Did you implement that? If so can we take a look at it?
I just looked at the log files now for testing the passive setup using the nsclient.ini file I sent earlier and I got the following read out:jdalrymple wrote:I do. Are passive checks being submitted now? If not then you need to watch your nsclient log to figure out why.
Code: Select all
2015-07-30 10:35:25: error:D:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: 192.168.1.246
2015-07-30 10:36:24: error:D:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: 192.168.1.246
2015-07-30 11:12:30: error:D:\source\nscp\modules\CheckSystem\CheckSystem.cpp:896: Failed to enumerate windows: 87: The parameter is incorrect.
2015-07-30 11:20:32: error:D:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: 192.168.1.246
2015-07-30 11:21:31: error:D:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: 192.168.1.246
2015-07-30 11:22:32: error:D:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: 192.168.1.246
2015-07-30 11:23:28: error:D:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: 192.168.1.246
2015-07-30 11:24:28: error:D:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: 192.168.1.246
2015-07-30 11:24:32: error:D:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: 192.168.1.246
2015-07-30 11:34:31: debug:D:\source\nscp\service\NSClient++.cpp:409: booting::loading plugins
2015-07-30 11:34:31: debug:D:\source\nscp\service\NSClient++.cpp:504: NSClient++ - 0.4.3.143 2015-04-29 Started!
2015-07-30 11:34:31: debug:D:\source\nscp\service\NSClient++.cpp:1356: Starting: DONECode: Select all
[/settings/default]
; ALLOWED HOSTS - A coma separated list of hosts which are allowed to connect. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = <ADD YOUR NAGIOS 1 IP HERE>,<ADD YOUR NAGIOS 2 IP HERE>,10.11.12.0/24Code: Select all
2015-07-30 12:00:07: debug:D:\source\nscp\service\NSClient++.cpp:541: Attempting to stop all plugins
2015-07-30 12:00:07: debug:D:\source\nscp\service\NSClient++.cpp:543: Stopping all plugins
2015-07-30 12:00:07: debug:D:\source\nscp\service\NSClient++.cpp:554: Stopping: COM helper
2015-07-30 12:00:07: debug:D:\source\nscp\service\NSClient++.cpp:573: Stopping: Settings instance
2015-07-30 12:00:08: debug:D:\source\nscp\service\NSClient++.cpp:409: booting::loading plugins
2015-07-30 12:00:08: debug:D:\source\nscp\service\NSClient++.cpp:504: NSClient++ - 0.4.3.143 2015-04-29 Started!
2015-07-30 12:00:08: debug:D:\source\nscp\service\NSClient++.cpp:1356: Starting: DONECode: Select all
root@storage:/usr/local/nagios/etc/objects# tcpdump port 5667
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
12:15:47.415525 IP Jerden-Vaio.42027 > storage.nsca: Flags [S], seq 3106634345, win 29200, options [mss 1460,sackOK,TS val 130990700 ecr 0,nop,wscale 7], length 0
12:15:47.415616 IP storage.nsca > Jerden-Vaio.42027: Flags [S.], seq 2489339415, ack 3106634346, win 28960, options [mss 1460,sackOK,TS val 20405410 ecr 130990700,nop,wscale 7], length 0
12:15:47.415904 IP Jerden-Vaio.42027 > storage.nsca: Flags [.], ack 1, win 229, options [nop,nop,TS val 130990700 ecr 20405410], length 0
12:15:47.416965 IP storage.nsca > Jerden-Vaio.42027: Flags [P.], seq 1:133, ack 1, win 227, options [nop,nop,TS val 20405410 ecr 130990700], length 132
12:15:47.417303 IP Jerden-Vaio.42027 > storage.nsca: Flags [.], ack 133, win 237, options [nop,nop,TS val 130990700 ecr 20405410], length 0
12:15:47.417776 IP Jerden-Vaio.42027 > storage.nsca: Flags [P.], seq 1:721, ack 133, win 237, options [nop,nop,TS val 130990701 ecr 20405410], length 720
12:15:47.417803 IP storage.nsca > Jerden-Vaio.42027: Flags [.], ack 721, win 238, options [nop,nop,TS val 20405411 ecr 130990701], length 0
12:15:47.417829 IP Jerden-Vaio.42027 > storage.nsca: Flags [F.], seq 721, ack 133, win 237, options [nop,nop,TS val 130990701 ecr 20405410], length 0
12:15:47.417991 IP storage.nsca > Jerden-Vaio.42027: Flags [F.], seq 133, ack 722, win 238, options [nop,nop,TS val 20405411 ecr 130990701], length 0
12:15:47.418144 IP Jerden-Vaio.42027 > storage.nsca: Flags [.], ack 134, win 237, options [nop,nop,TS val 130990701 ecr 20405411], length 0Thank you so much! I will give it a go, the only other thing I have come across now is the NRPE plugin. It seems the NSCA calls rely on the NRPE plugin to decipher the proper checks. So I'm in the midst of installing nrpe-2.15 on the Nagios server. I kept getting an error while running ./configure about SSL libraries so if anyone else has that problem I tried to get around it by running:tgriep wrote:I noticed that in youe NSClient log, you are running a newer version of the NSClient that has changed the format of the nsclient.ini so much that your example that you uploaded will not work.
I attached a copy that should work for you but you will need to edit the IP Addresses, passwords, etc.
Give it a try and see if that helps out.
Code: Select all
dpkg -L libssl-devCode: Select all
./configure --with-ssl=/usr/include/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnuCode: Select all
checking for SSL libraries... SSL libraries found in /usr/lib/x86_64-linux-gnu
*** Generating DH Parameters for SSL/TLS ***
./configure: line 7553: /usr/include/openssl/../bin/openssl: No such file or directory
checking for Kerberos include files... could not find include filesCode: Select all
make all
cd ./src/; make ; cd ..
make[1]: Entering directory `/home/futuresign/Downloads/nagios/nrpe-2.15/src'
gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c ./utils.c ./acl.c -L/usr/lib/x86_64-linux-gnu -lssl -lcrypto -lnsl
./nrpe.c: In function ‘main’:
./nrpe.c:269:5: warning: assignment makes pointer from integer without a cast [enabled by default]
dh=get_dh512();
^
./nrpe.c:204:9: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
getcwd(config_file,sizeof(config_file));
^
./nrpe.c:309:8: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result [-Wunused-result]
chdir("/");
^
./nrpe.c:379:8: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result [-Wunused-result]
chdir("/");
^
./nrpe.c: In function ‘my_system’:
./nrpe.c:1491:6: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
pipe(fd);
^
./nrpe.c:1544:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(fd[1],buffer,strlen(buffer)+1);
^
./nrpe.c:1554:10: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(fd[1],buffer,bytes_read);
^
./nrpe.c: In function ‘write_pid_file’:
./nrpe.c:1766:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(fd,pbuf,strlen(pbuf));
^
/tmp/ccXLGRS0.o: In function `main':
/home/futuresign/Downloads/nagios/nrpe-2.15/src/./nrpe.c:269: undefined reference to `get_dh512'
collect2: error: ld returned 1 exit status
make[1]: *** [nrpe] Error 1
make[1]: Leaving directory `/home/futuresign/Downloads/nagios/nrpe-2.15/src'
*** Compile finished ***
If the NRPE daemon and client compiled without any errors, you
can continue with the installation or upgrade process.
Read the PDF documentation (NRPE.pdf) for information on the next
steps you should take to complete the installation or upgrade.
Code: Select all
make install-plugin
make install-daemon
make install-daemon-configOh my god! Your nsclient.ini works! TCPDump is reporting back connection attempts on port 5667. Oh happy days! Now to get Nagios to actually decipher the messages.tgriep wrote:I noticed that in youe NSClient log, you are running a newer version of the NSClient that has changed the format of the nsclient.ini so much that your example that you uploaded will not work.
I attached a copy that should work for you but you will need to edit the IP Addresses, passwords, etc.
Give it a try and see if that helps out.
Code: Select all
Checking objects...
Error: Service check command 'check_nrpe!alias_cpu' specified in service 'CPU Load' for host 'windowshost' not defined anywhere!
Error: Service check command 'check_nrpe!alias_disk' specified in service 'Free Space' for host 'windowshost' not defined anywhere!
Checked 10 services.
Checked 2 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 25 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 2