I wrote a python test plugin /usr/lib64/nagios/plugins/check_test.py . The file content is below:
#!/etc/python
print "Hello, World!"
exit(0)
ls -la /usr/lib64/nagios/plugins/check_test.py
output below
-rwxrwxrwx. 1 root root 44 Sep 20 11:03 /usr/lib64/nagios/plugins/check_test.py
Added below to /etc/icinga2/conf.d/command.conf
object CheckCommand "test" {
command = [ PluginDir + "/check_test.py" ]
}
Added below to /etc/icinga2/conf.d/services.conf
apply Service "test" {
import "generic-service"
check_command = "test"
assign where host.address
}
On icingaweb2. I see the service is available. But its showing UNKNOWN status with
Plugin Output
execvpe(/usr/lib64/nagios/plugins/check_test.py) failed: Permission denied