docs:tips_n_tricks:nagios:using_http_for_passive_checks
This is an old revision of the document!
Using HTTP for passive checks
This description is valid for Nagios 3 and sketches a quick-and-dirty approach.
In situations, where you cannot use send_nsca
for submitting passive check results over the network, you can use the Nagios web interface. You need an http account
- Allowed to access nagios by your webserver, normally accomplished with Basic Auth and htpasswd.
- Allowed to view all services/hosts1) via
/etc/nagios3/cgi.cfg
- Allowed to submit commands for all services/hosts2)
wget -O - --user=http_remote \ --auth-no-challenge \ --no-check-cert \ 'https://<nagios-server>/cgi-bin/nagios3/cmd.cgi'\ '?cmd_typ=30'\ '&cmd_mod=2'\ '&host=localhost'\ '&service=TEST'\ '&plugin_state=3'\ '&plugin_output=Test+mit+wget+II'\ '&btnSubmit=Commit'
Of course, in a large environment with appropriate security needs, you would write a php script that is restricted to write passive checks.
1)
pick the one you need
2)
pick the one you need) via
/etc/nagios3/cgi.cfg
Assuming you have your credetionals for the account http_remote saved in either ~/.wgetrc
or ~/.netrc
, this example will submit a passive check result for the service TEST on host localhost in status UNKNOWN((which is numerically 3docs/tips_n_tricks/nagios/using_http_for_passive_checks.1350915490.txt.gz · Last modified: 22.10.2012 16:18 CEST by peter