<div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have a question about nsca and service checks. I am running nsca 2.6 and Nagios 2.5. I have just trying to send a simple test service check to Nagios to see if I can get the state to change…and it isn’t working…<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here is what I am trying to do…<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">From the remote
machine:<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">/usr/bin/send_nsca –H ian -d “;” –c /etc/send_nagios.cfg < test<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The file test contains:<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">mike;nmbd;2;’ok-just one test’<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have configured nsca on the Nagios server and the config file
contains:<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">server_port=5667<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">server_address=192.168.1.10<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">nsca_user=nagios<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525;
FONT-FAMILY: TheSansMonoCondensed-SemiLight">nsca_group=nagios<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">debug=0<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">command_file=/usr/local/nagios/var/rw/nagios.cmd<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">alternate_dump_file=/usr/local/nagios/var/rw/nsca.dump<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY:
TheSansMonoCondensed-SemiLight">aggregate_writes=0<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">append_to_file=0<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">max_packet_age=30<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">password=password<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">decryption_method=10<o:p></o:p></SPAN></FONT></div> <div
class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">The send_nagios.cfg contains:<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">password=password<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">encryption_method=10<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN
style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">My service check is:<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">define service{<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY:
TheSansMonoCondensed-SemiLight"> host_name mike<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> service_description syslog-ng<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> active_checks_enabled 0<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY:
TheSansMonoCondensed-SemiLight"> passive_checks_enabled 1<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> check_freshness 0<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> is_volatile 1<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY:
TheSansMonoCondensed-SemiLight"> max_check_attempts 1<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> normal_check_interval 1<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> retry_check_interval 1<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">
check_period none<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> contact_groups nagios-admins<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> check_command check_dummy!2!Critical<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY:
TheSansMonoCondensed-SemiLight"> notification_options w,c,u<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> notification_period 24x7<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> notification_interval 120<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"> }<o:p></o:p></SPAN></FONT></div>
<div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">The /var/log/messages file shows the following:<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">Nov 21 00:09:00 ian nsca[12202]: SERVICE CHECK -> Host Name: 'mike', Service Description: 'nmbd', Return Code: '2', Output:
''ok-just one test''<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">Nov 21 00:09:47 ian nagios: EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;mike;nmbd;2;'ok-just one test'<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">It appears that the
external command file is getting the check…but the host page just sits there saying that the host hasn’t been checked. I have tried several different states and still the same result. I understand that an active check isnt being performed but I would think that because of the above "PROCESS_SERVICE_CHECK_RESULT" line that the nagios.cmd file got the message and the page should be updated with a critical message.</SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">I read in the docs that the check needs to have the date in front of it …but when I tried that I couldn’t get nsca to expand the variable…I have
checked permissions, etc.<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">So…where have I messed up? LOL.<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=TheSansMonoCondensed-SemiLight color=#252525 size=1><SPAN style="FONT-SIZE: 9pt; COLOR: #252525; FONT-FAMILY: TheSansMonoCondensed-SemiLight">Any help is greatly appreciated.<o:p></o:p></SPAN></FONT></div><p>
<font color="666666"><font size="2"><hr size=1>Sponsored Link</font></font><br><br>
<a href="https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=b_rate150k&s=3968&p=5035&disc=y&vers=722">Mortgage rates as low as 4.625% - $150,000 loan for $579 a month. Intro-*Terms</a>