How to execute nagios commands from command line in linux

I am using a nagios o centos server and I want to track only the local host.

I defined my service like this

define service{ host_name localhost service_description Site1Service check_command check_http-site1 use generic-service notification_interval 1440 } 

and

run command.cfg

 define command{ command_name check_http-site1 command_line /usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com } 

I get a critical error there. so I want to check from the command line if this service is running or not

+4
source share
1 answer

You have the answer in your config - just execute in the shell:

 /usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com 

You can add -v for verbose output.

Nagios is only a scheduler and executes commands at regular intervals. It then reports the state based on the response.

+8
source

Source: https://habr.com/ru/post/1490445/


All Articles