Monitoring Lenovo xclarity using Nagios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Monitoring Lenovo xclarity using Nagios

Post by ets_user »

Hi,

We are using Lenovo hardware and we have Xclarity admin for monitoring the all the servers.

We tried to integrate Xclarity to nagios referring the link below.
https://sysmgt.lenovofiles.com/help/ind ... lcome.html

Completed till step 4 successfully and from step 5 its all execution in command line.

We have Nagios XI installed and we would like to proceed from step 5 in Nagios XI.

Would be great if you could help on this since XI is UI based and easy to understand and setup.

Thanks.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring Lenovo xclarity using Nagios

Post by cdienger »

Once you've installed a plugin and can confirm it runs from the command there are only a few steps that need to be done in XI to complete the integration:

-define the command
-define a service to use the command

https://assets.nagios.com/downloads/nag ... ios-XI.pdf covers the details of these steps.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Re: Monitoring Lenovo xclarity using Nagios

Post by ets_user »

Hi,

Thanks for the document link share.

We tried the steps as mentioned in the link.
https://sysmgt.lenovofiles.com/help/ind ... lcome.html

In step 5 its mentioned we have to provide the instance name as given in step 3 (<XCLARITY_ADMINISTRATOR_NAME> is the name of the XClarity Administrator instance that you specified in step 3.)

But while executing step 3 command it did ask me only username password and URL.

So which name i can use it while defining the command and service.

And its throwing below error if i try with any name,

Warning
(No output on stdout) stderr: Traceback (most recent call last):
File "/usr/local/nagios/libexec/xclarity_integrator_check_v1.0.0.py", line 553, in <module>
status_lxca_bad, status_lxca_good, exit_status = check_lxca(_args, write_to_log_flag)
File "/usr/local/nagios/libexec/xclarity_integrator_check_v1.0.0.py", line 483, in check_lxca
bad_devices, good_devices, exit_status = get_bad_devices(_args.lxca)
File "/usr/local/nagios/libexec/xclarity_integrator_check_v1.0.0.py", line 206, in get_bad_devices
devices = get_devices(lxca_instance).get("nodeList")
File "/usr/local/nagios/libexec/xclarity_integrator_check_v1.0.0.py", line 92, in get_devices
return api_call("{0}/nodes?includeAttributes=name,overallHealthState,ipv4Addresses&status=managed".format(storedUrl), lxca_instance)
File "/usr/local/nagios/libexec/xclarity_integrator_check_v1.0.0.py", line 74, in api_call
f.write(certificate)
TypeError: expected a character buffer object

Thanks.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Monitoring Lenovo xclarity using Nagios

Post by ssax »

Use "system" for the instance name, let us know if that works.
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Re: Monitoring Lenovo xclarity using Nagios

Post by ets_user »

Tried to use 'system' as user name and added to NagiosXI.

But while service check getting the attached error.

Thanks.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Monitoring Lenovo xclarity using Nagios

Post by ssax »

What I meant was for you to use your standard username and password for the configurator but use the system in the command definition:

Code: Select all

command_line $USER1$/xclarity_integrator_check.py --lxca system
Did you do that?

Are you using version 1.0.0 or 1.1.0? 1.1.0 version is here:

Code: Select all

https://support.lenovo.com/ro/en/solutions/HT507298
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Re: Monitoring Lenovo xclarity using Nagios

Post by ets_user »

Yes , i tried doing the same.

And the Xclarity version we are using is 2.6.0.

Please let me know the corresponding plugin to be used.

Thanks.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Monitoring Lenovo xclarity using Nagios

Post by ssax »

Use this one here and rerun through the procedure to generate your credentials:

https://support.lenovo.com/ro/en/solutions/HT507298

Make sure you su - nagios before running the commands:

https://sysmgt.lenovofiles.com/help/ind ... lcome.html
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Re: Monitoring Lenovo xclarity using Nagios

Post by ets_user »

We tried the below and please find the logs.

Kindly advise.

[root@XXXX libexec]# python xclarity_integrator_check_v1.0.0.py generate_credentials
Enter username: admin
Enter password:
Enter URL for LXCA instance (example: https://10.252.48.38)
URL: https://XX.XXX.XX.XX
Please set a password for your new keyring
Password:
Password (again):
Please input your password for the keyring
Password:
Please input your password for the keyring
Password:
Please input your password for the keyring
Password:
Traceback (most recent call last):
File "xclarity_integrator_check_v1.0.0.py", line 540, in <module>
generate_hash_credentials()
File "xclarity_integrator_check_v1.0.0.py", line 200, in generate_hash_credentials
certificate = get_certificate(url, username, password)
File "xclarity_integrator_check_v1.0.0.py", line 111, in get_certificate
return api_call_certificate("{0}/signingCertificate/pem".format(url), username, password)
File "xclarity_integrator_check_v1.0.0.py", line 82, in api_call_certificate
response.raise_for_status()
File "/usr/lib/python2.7/site-packages/requests/models.py", line 834, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Monitoring Lenovo xclarity using Nagios

Post by ssax »

You're not running the right script.

Code: Select all

cd /usr/local/nagios/libexec
python Xclarity_integrator_check.py generate_credentials
Use the script here:

https://support.lenovo.com/ro/en/solutions/HT507298

Likely need to do this as well:

Code: Select all

chown apache.nagios /usr/local/nagios/libexec/Xclarity_integrator_check.py
chmod ug+x /usr/local/nagios/libexec/Xclarity_integrator_check.py
Locked