Page 1 of 1

Error when executing my own plugin

Posted: Sun May 20, 2018 9:25 pm
by pedropedro
Hey all, i have developped a pluging that extract results from an Oracle database, it workin fine when i try to execute it in Terminal with the command: ./check_bdd_request.pl --hostname=xxx.xxx.xx.xx --user=nagios --password=xxxx --database=xxxxx --port=1521 --request="SELECT username, expiry_date - sysdate, account_status FROM dba_users" --check_type=TEXT --warn=-1. The result is shown on the figure attached.

i add the plugin check_bdd_request.pl to the path /usr/local/nagios/libexec with permissions (chmod +x check_bdd_request.pl) -> i have defined my command in commads.cfg also i have defined my service in windows.cfg i restared nagios succesfly ... but when i try to connect to my nagios core interface the service "Oracle_Server:My_Own_Plugin" doesn"t work .. i got the Error: Return code of 127 is out of bounds - plugin may be missing .. i don"t know what should i do to fix this .

look at the pictures attached please.
thanks for everyone that can help me.

Re: Error when executing my own plugin

Posted: Mon May 21, 2018 4:59 am
by pedropedro
Hy, you can lock this Post. i have solved this issue.
this is the modification for everyone with the same problem :)

in my configuration file commands.cfg:

define command {
command_name check_bdd_request
command_line /usr/local/nagios/libexec/check_bdd_request.pl # In the fisrt time i don't set the name of plugin completely : i just
# write check_bdd_request , so nagios doesn't find the plugin: ( i add .pl)
}

hope i will help some one day with the same problem. :D ;)
thanks.