Dell Open Manage Plugin for Nagios xi

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
ryem1340
Posts: 11
Joined: Fri Sep 20, 2019 5:34 am

Dell Open Manage Plugin for Nagios xi

Post by ryem1340 »

Hi All,

I am trying to setup monitoring for Dell EMC PowerEdge Servers and is using the Dell EMC Plugin.
Downloaded from : https://exchange.nagios.org/directory/P ... xi/details

I have managed to install the plugin. Had to install via Cli as the upload from the GUI was not working , just fails. Ran the Discovery using the SNMP and it discovered the iDRAC. Had to tweak the Wizard to use the Python 3.x (https://support.nagios.com/forum/viewto ... 16&t=57793) . When I submit to create the checks via the wizard it creates the check but it fails .

The reason is , the command which created by the template -

python $USER1$/dellemc_device_check.py --host=$HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$

Unfortunately the Nagios is allowing only 8 arguments . I can change the command but am not sure what the arguments mean ? Does anyone know what we need to pass to these argument 9,10 and 11

$ARG9$ $ARG10$ $ARG11$

or whether we have an option to allow more Arguments while applying the templates?
You do not have the required permissions to view the files attached to this post.
ryem1340
Posts: 11
Joined: Fri Sep 20, 2019 5:34 am

Re: Dell Open Manage Plugin for Nagios xi

Post by ryem1340 »

Hi ,

Managed to identify the Arguments and running them in CLi works with root account but not with Nagios user. So they do not work via GUI also
Current Permissions attached below :
perm.PNG
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Dell Open Manage Plugin for Nagios xi

Post by benjaminsmith »

Hi @ryem1340,

By default, Nagios xi will set the permissions to 775, you can run the following command to set it.

Code: Select all

chown apache:nagios /usr/local/nagios/libexec/plugin_name
chmod 775 /usr/local/nagios/libexec/plugin_name
That's correct Nagios xi will only allow up to eight arguments (Core can handle more) and it looks like the template file included in the Wizard contains sample commands for Nagios Core. Now, that you have it working in the CLI, you can try to modify the check command and combine arguments. Let me know if you get it working.

Regards,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Dell Open Manage Plugin for Nagios xi

Post by dchurch »

The software doesn't support more than 8 arguments to plugin scripts. If you need to combine add more, you can insert a space character in the field and it should break as a shell would. For example:

For example, given the template and inputs:
Template: "python $USER1$/dellemc_device_check.py --host=$HOSTADDRESS$ $ARG1$ $ARG2$"
Inputs:
  • ARG8=foo bar
  • ARG2=baz
  • HOSTADDRESS=127.0.0.1
It'll generate the command line like so, and run it as if it were typed exactly that way:

Code: Select all

python /usr/local/nagios/libexec/dellemc_device_check.py --host=127.0.0.1 foo bar baz
It appears that plugin has some issues. I'd suggest contacting Dell to have them modify it to only use ARG0-8.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
ryem1340
Posts: 11
Joined: Fri Sep 20, 2019 5:34 am

Re: Dell Open Manage Plugin for Nagios xi

Post by ryem1340 »

Hi All,

Thanks for your suggestions. I have tried to amend the check and getting error in output. I am using the exact same command which works via CLi.
Screenshots below :
RunCheck1.PNG
If you look at the RunCheck screenshot, It does nothing. I was expecting to see the output on the Runcheck window

Below is the actual output I see on the service check.
You do not have the required permissions to view the files attached to this post.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Dell Open Manage Plugin for Nagios xi

Post by dchurch »

Sounds like a different error than the one you were receiving.

After consulting with my team, we think the script cannot access this file: /usr/local/nagios/libexec/dellconfigLoc.cfg. Try chmod/chown so that the nagios user on the system can read from it.

If that doesn't work, you could try checking the syntax of the dellemc_device_check.py file by pasting it into this tool: https://extendsclass.com/python-tester.html
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
ryem1340
Posts: 11
Joined: Fri Sep 20, 2019 5:34 am

Re: Dell Open Manage Plugin for Nagios xi

Post by ryem1340 »

I tried a chmod/chown on the file to confirm. The file was having the correct permissions anyways.
No luck . Still has the same error.
Also verified the Syntax for the .py and it says Syntax is ok .
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Dell Open Manage Plugin for Nagios xi

Post by dchurch »

I was able to get it to successfully run from the command line, but first I had to change it a little. I noticed that "python --version" was returning 2.7.x, which is EOL and might be helped by using python3 to run the actual check. It's likely that way on your system too since it's the default in CentOS, Ubuntu, Slackware, etc.

Step 0

Modify templates/dell_command.cfg to invoke the script with python3 instead of python, and eliminate $ARG9$ thru $ARG11$:

Code: Select all

 define command{
                command_name    dellemc_check_script
                command_line    python3 $USER1$/dellemc_device_check.py  --host=$HOSTADDRESS$  $ARG1$  $ARG2$  $ARG3$  $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$
        }
define command{
                command_name    dellemc_warranty_check_script
                command_line    python3 $USER1$/dellemc_device_check.py  --host=$HOSTADDRESS$  $ARG1$  $ARG2$  $ARG3$  $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$
        }
Step 1

Log into the host system and install some Python libraries:

Code: Select all

sudo apt install python3-pip # Ubuntu
sudo yum install python3-pip # CentOS
sudo pip3 install omsdk netaddr
Step 2

Test it out from the command line:

Code: Select all

mkdir -p /tmp/.dell-logs
python3 /usr/local/nagios/libexec/dellemc_device_check.py --host=127.0.0.1 --devicetype=iDRAC --protocol=1 --snmp.version=2 --snmp.community=foo --snmp.retries=1 --snmp.timeout=3 --snmp.port=161 --logPath=/tmp/.dell-logs
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
ryem1340
Posts: 11
Joined: Fri Sep 20, 2019 5:34 am

Re: Dell Open Manage Plugin for Nagios xi

Post by ryem1340 »

Hi @dchurch,

Thank you , I have tried this previously as well.
The check works fine both with python 2.7.x and python 3.6.x in Nagios CLi. I have tried with root user and nagios user both returns output - No issues.

But when we use the Run Check or we configure the check from Nagios GUI it fails. Can't find anything different as I am using the exact same command on the Cli and it works . I am thinking its a permission issue on how the GUI/Service checks this. Really a weird one ..
ryem1340
Posts: 11
Joined: Fri Sep 20, 2019 5:34 am

Re: Dell Open Manage Plugin for Nagios xi

Post by ryem1340 »

I have got it working now. Thank you @dchurch for the help.

The GUI was not able to call the python using the symlink although it worked in the CLi. I have provided the complete path for Python on the command and its working now. :)