Nagios External Commands
Dan Garthwaite
dan at garthwaite.org
Fri Oct 30 14:40:46 EDT 2015
Things to check:
command_check_interval=-1
command_file=/usr/local/nagios/var/rw/nagios.cmd
Make sure command_file is readable by nagios user.
What does the nagios log say?
/var/log/nagios/nagios.log (or somesuch)
Usually it is a permissions error.
On Fri, Oct 30, 2015 at 1:46 PM, Kenny Lussier <klussier at gmail.com> wrote:
> Hi All,
>
> I find myself back to working with Nagios after a long hiatus of using
> much friendlier monitoring systems....
>
> I'm trying to set up snmp trap monitoring, which I've dome in the past,
> but I'm missing something that I just can't seem get. I can send a trap
> from a system, the trap is received by the trap catcher, it's handed off to
> snmptt for translation, which uses the EXEC line to put an external command
> in the nagios.cmd file. That all works. But notifications aren't sent, and
> the status of the service never changes.
>
> So:
>
> snmptrap -v 2c -c public util1 '' .1.3.6.1.6.3.1.1.5.5 ## runs on util2
>
>
> Fri Oct 30 17:42:03 2015 .1.3.6.1.6.3.1.1.5.5 Normal "Status Events" util2
> - An authenticationFailure trap signifies that the SNMP ## Shows up on
> util1 in snmptt.log
>
> [1446226923] PROCESS_SERVICE_CHECK_RESULT;util2;TRAP;1;An
> authenticationFailure trap signifies that the SNMP ## Shows up in
> nagios.cmd
>
> So, it appears that everything is set up correctly, but Nagios isn't
> processing the external service check command and setting the status to
> warning and sending me an email.
>
>
> Any ideas?
>
> TIA,
> Kenny
>
>
>
> My configs look like this:
>
> define service {
> name TRAP
> service_description TRAP
> active_checks_enabled 0 ; Active service checks are enabled
> passive_checks_enabled 1 ; Passive service checks are
> enabled/accepted
> process_perf_data 0
> obsess_over_service 0 ; We should obsess over this
> service (if necessary)
> check_freshness 1 ; Default is to NOT check service
> 'freshness'
> freshness_threshold 93600
> notifications_enabled 1 ; Service notifications are enabled
> event_handler_enabled 1 ; Service event handler is enabled
> flap_detection_enabled 0 ; Flap detection is enabled
> process_perf_data 1 ; Process performance data
> retain_status_information 1 ; Retain status information across
> program restarts
> retain_nonstatus_information 1 ; Retain non-status information
> across program restarts
> check_command check-host-alive ; This will be used
> to reset the service to "OK"
> is_volatile 1
> check_period 24x7
> max_check_attempts 1
> normal_check_interval 1
> retry_check_interval 100
> notification_interval 1
> notification_period 24x7
> notification_options w,u,c,r
> contact_groups klussier ; Modify this to match your
> Nagios contact group definitions
> register 0
> }
>
> define contact{
> contact_name klussier
> alias klussier
> service_notification_period 24x7
> host_notification_period 24x7
> service_notification_options w,u,c,r
> host_notification_options d,u,r
> service_notification_commands notify-by-email
> host_notification_commands host-notify-by-email
> email klussier@
> }
>
> define contactgroup{
> contactgroup_name klussier
> alias klussier
> members klussier
> }
>
>
> define service{
> host_name util2
> use TRAP
> contact_groups klussier
> }
>
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/pipermail/gnhlug-discuss/attachments/20151030/12e50cbe/attachment.html
More information about the gnhlug-discuss
mailing list