I am a beginner in icinga and nagios usage for server management. I setup icinga on a machine and set up all the basics. The next step I tried was to check if certain services were running at ports 8080, 8081 and 8082
or not. I wrote a quick python script for that. I placed that file under /usr/local/lib/myscript.py
. The next step I did was to create a command under /etc/nagios-plugins/config/testone.cfg
. My command looks like this
define command{
command_name check_restarts
command_line python /usr/local/lib/myscript.py -w 3 -c 5 -p 8080
command_line python /usr/local/lib/myscript.py -w 3 -c 5 -p 8081
command_line python /usr/local/lib/myscript.py -w 3 -c 5 -p 8082
}
I then added a service to services.conf under /etc/icinga2/conf.d/services.conf
. But this leads to an error when I restart icinga which shows up a message Backend icinga not running
on the UI and errors point to services.conf
when I try sudo service icings2 status
.
Can anyone please guid me around these steps?
Best Answer
Don't get confused with
Icinga
andIcinga2
. They are different tools.Icinga2
configuration format is different fromIcinga
andNagios
. So there is a big change in configuring objects inicinga2
. See the official migration doc: URLSo for your case, you need to use
CheckCommand
instead ofcommand
. Alsoservice
definition needs to be changed.All config files are inside
/etc/icinga2
dir and Plugin dir should be defined inside/etc/icinga2/constants.conf
file.check
Icinga2
config files for syntax errors before restart/reload with command:/etc/init.d/icinga2 checkconfig