How to submit passive test results from a script?

Hari Sekhon hpsekhon at googlemail.com
Mon Feb 11 11:13:03 CET 2008


Tom Wlodek wrote:
> Ladies and gentlemen,
>
> I have a service running on nagios server and I would like to submit
> passive test results from a client script.
>
> I see that nagios has an interface to submit those results:
>
> https://my.nagios.com/nagios/cgi-bin/cmd.cgi?
> cmd_typ=30&host=my.host.com&service=nagios+test+service&
>
> I go there and I see a form. All it takes is to fill this form and then
> clic submit.
>
> So I figured out that if I embed the form fields in URL and then load
> the URL then I will effectively submit the form. So I do:
>
> https://my.nagios.com/nagios/cgi-bin/cmd.cgi?
> cmd_typ=30&host=my.host.com&service=nagios+test
> +service&plugin_state=3&plugin_output=pluginOuttput&performance_data=test&btnSubmit=Commit
>
> I load this page - and nothing happens.
>
> How do you submit passive test results to nagios from scripts
If all you want to do is to run a plugin or something and submit the 
result to Nagios as a passive service check, then you want to use NSCA.

If you want to do it the easy and standard way, use the nsca_wrapper 
plugin I wrote which turns runs a plugin you supply on the command line 
and then submits the result to Nagios. It saves having to reinvent the 
scripted wheel for this as it's a complete waste of time (I realized I 
didn't want to write a wrapper script for every new passive service 
check, hence this is generic enough for converting and standard plugin 
check in to a passive service check that you can just easily stick in Cron).

If you are curious how to do it, just read my code, it's Bash and 
available on Nagios Exchange here:

http://www.nagiosexchange.org/Check_Plugins.21.0.html?&tx_netnagext_pi1[p_view]=980

-h

-- 
Hari Sekhon


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list