Hello ,
We have one custom python script which contain SQL queries, DB server connectivity details and some calculation to fetch Total/failed Transaction data from database. Manually We are able to execute script successfully, but we failed to create command check for this python script in Icinga. Icinga is giving below error.
2021-11-25 10:52:18 +0530] warning/PluginCheckTask: Check command for object 'SERVER-1 Trx Mon' (PID: 146005, arguments: '/usr/lib64/nagios/plugins/trx_mon.py') terminated with exit code 128, output: execvpe(/usr/lib64/nagios/plugins/trx_mon.py) failed: No such file or directory
Manual Execution
[root@Server-ICINGA plugins]# python3 trx_mon.py
OK - Failed transactions within the Threshold of 15 per participant
Command Definition
object CheckCommand "trx_mon" {
import "plugin-check-command"
command = [ PluginDir + "/trx_mon.py" ]
vars.trx_host = "$address$"
}
Service Definition
apply Service "Trx Mon" {
check_command = "trx_mon"
check_interval = 1m
retry_interval = 1m
vars.grafana_infra_mail = true
vars.notification["mail"] = {
/* The UserGroup `icingaadmins` is defined in `users.conf`. */
groups = [ "infra-team" ]
}
assign where host.address == "10.13.x.x"
}
[root@INMB1-MON-NewICINGA plugins]# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.2-1)
Copyright (c) 2012-2018 Icinga Development Team (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
System information:
Platform: Red Hat Enterprise Linux Server
Platform version: 7.6 (Maipo)
Kernel: Linux
Kernel version: 3.10.0-1160.45.1.el7.x86_64
Architecture: x86_64
Build information:
Compiler: GNU 4.8.5
Build host: unknown
Application information:
General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2
Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var
Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid
Can you guide us, how to resolve this issue ?
Thanks