Nagios plugin with argument doesn't work
Posted: Mon Jul 27, 2020 8:45 am
Hello,
I have created a plugin developped in bash which check content of TSM log.
The plugin can be launched without any argument like that : /usr/lib64/nagios/plugins/check_backup_tsm
Or it can be launched with an argument like that : /usr/lib64/nagios/plugins/check_backup_tsm no_check_sunday
When I use the plugin without the argument, it works just fine but as soon as I use it with the argument it doesn't work correctly. It's launched as it doesn't have argument
Here are my conf :
Content of /etc/nagios/nrpe.cfg :
command[check_backup_tsm]=/usr/lib64/nagios/plugins/check_backup_tsm $ARG1$
Content of /etc/nagios/objects/commands.cfg :
define command{
command_name NRPE_check_backup_tsm
command_line $USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c check_backup_tsm -a $ARG1$
}
Content of /etc/nagios/objects/services.cfg :
define service{
use generic-service ; Name of service template to use
host_name GITLAB APP S01VL9907789, GITLAB APP S01VL9907788, GITLAB DATA S01VL9907787, GITLAB DATA S01VL9907786, GITLAB REDIS S01VL9907785, GITLAB REDIS S01VL9907784
service_description Last BackupUp
check_command NRPE_check_backup_tsm!no_check_sunday
#check_period early
servicegroups Gitlab
notifications_enabled 1
contacts nagiosadmin
I have reloaded/restarted my nagios service on server side.
Would you please advise ?
Thanks,
Regards.
I have created a plugin developped in bash which check content of TSM log.
The plugin can be launched without any argument like that : /usr/lib64/nagios/plugins/check_backup_tsm
Or it can be launched with an argument like that : /usr/lib64/nagios/plugins/check_backup_tsm no_check_sunday
When I use the plugin without the argument, it works just fine but as soon as I use it with the argument it doesn't work correctly. It's launched as it doesn't have argument
Here are my conf :
Content of /etc/nagios/nrpe.cfg :
command[check_backup_tsm]=/usr/lib64/nagios/plugins/check_backup_tsm $ARG1$
Content of /etc/nagios/objects/commands.cfg :
define command{
command_name NRPE_check_backup_tsm
command_line $USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c check_backup_tsm -a $ARG1$
}
Content of /etc/nagios/objects/services.cfg :
define service{
use generic-service ; Name of service template to use
host_name GITLAB APP S01VL9907789, GITLAB APP S01VL9907788, GITLAB DATA S01VL9907787, GITLAB DATA S01VL9907786, GITLAB REDIS S01VL9907785, GITLAB REDIS S01VL9907784
service_description Last BackupUp
check_command NRPE_check_backup_tsm!no_check_sunday
#check_period early
servicegroups Gitlab
notifications_enabled 1
contacts nagiosadmin
I have reloaded/restarted my nagios service on server side.
Would you please advise ?
Thanks,
Regards.