Error when executing my own plugin

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pedropedro
Posts: 9
Joined: Mon Apr 02, 2018 3:31 am

Error when executing my own plugin

Post 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.
Attachments
plugin_work fine in terminal.PNG
permissions_Plugin.PNG
My_Own_Plugin.PNG
pedropedro
Posts: 9
Joined: Mon Apr 02, 2018 3:31 am

Re: Error when executing my own plugin

Post 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.
Locked