Lenovo XClarity

Hi,
there seems to be an nagios agent for Lenovo XClarity https://support.lenovo.com/us/en/solutions/ht507298
This queries the xclarity controller of lenovo servers to be monitored in check_mk.

Any idea how to integrate this in check_mk?
The Lenovo Howto http://sysmgt.lenovofiles.com/help/topic/com.lenovo.lxci_nagios.doc/nagios_welcome.html on this eplains how to intergrate this in nagios but I get stuck on applyint this on cmk.

Thanks for any advice.
Philipp

1 Like

I had a look at the Python file provided on the Lenovo website. With this information i would be possible to build an special agent.

To use this script directly inside CMK would be a little bit problematic until release of CMK 2.0 as it needs Python3 as interpreter.

If someone need to include XClarity management controller inside CMK, i wrote a special agent as a first version to test.

If there are problems or errors please let me know.

3 Likes

Hello Andreas, I’m trying your special agent without any luck. I tried with both CMK 1.6 and 2.0, they throw both two different error:
In 1.6:

ERROR: Agent exited with code 1: Traceback (most recent call last):
  File "/omd/sites/mysite/local/share/check_mk/agents/special/agent_lenovo_xclarity", line 24, in <module>
import lenovo_utils as utils
  File "/omd/sites/mysite/local/lib/python/lenovo_utils.py", line 23, in <module>
import redfish
ImportError: No module named redfish

In 2.0:

Agent exited with code 1: Traceback (most recent call last):
File "/omd/sites/mysite/local/share/check_mk/agents/special/agent_lenovo_xclarity", line 24, in <module>
import lenovo_utils as utils
ImportError: No module named lenovo_utils

Inside the package is written that you need to install the Redfish Python module.

Redfish Python module must be installed
pip install redfish

For 2.0 it will not work without some adjustments.

@andreas-doehler, thank you for your work on the redfish stuff
for HP/HPE ILO and XClarity.

But for us this is much to much.

What we are looking for is one simple overall health check.
Like the yellow status LED on the Server.

If the LED goes to yellow/red from green we investigate further
by manually login into the xclarity gui.

We have a lot of servers and we do not want e.g. 32 temperature sensors per ILO/XClarity.

I am now going to use something like this:

$ snmpget -m all -v 3 -u <user> <xclarity-host>  1.3.6.1.4.1.19046.11.1.1.4.1.0

LENOVO-XCC-MIB::systemHealthStat.0 = INTEGER: normal(255)

with check_snmp nagios integration:

$ ~/lib/nagios/plugins/check_snmp -H <xclarity-host> -o 1.3.6.1.4.1.19046.11.1.1.4.1.0 -U <user> -P3 -m ALL -c 255:255

SNMP OK - 255 | LENOVO-XCC-MIB::systemHealthStat.0=255;;255:255

But I am not sure if this is sufficent.
These look usefull as well:

$ curl --user '<user>:<pass>' --silent --insecure https://<xclarity-host>/redfish/v1/Systems/1 | jq -r '.Status.Health' 
OK

$ curl --user '<user>:<pass>' --silent --insecure "https://<xclarity-host>/redfish/v1/Chassis/1" | jq -r '.IndicatorLED'  
Off

$ curl --user '<user>:<pass>' --silent --insecure "https://<xclarity-host>/redfish/v1/Chassis/1" | jq -r '.Status.Health' 
OK

Perhaps if you a bored one day, you might want to include the overall health status as check in your mkp ?

Thanks, I am looking forward to talk to you in person on the conference!

There is an overall health check already included. At the moment i don’t know if i have done it also for the XClarity but for the latest Dell iDRAC it is there.
With Redfish you have for every component one normal health state and one rollup health state if this component included other sub components.
For the wanted overall health state you can use the chassis rollup health state and this will show the complete system state.

Inside the XClarity check this part is missing.
On my to-do list, is the point - unified Redfish agent for all manufacturers.
If i have some Lenovo systems in the meantime i will have a look at the system state.
It is also on thing to do - on the special agent site - configurable sections for the agent.

Here you can make a smart exclude rule that you only see the ambient temperature or nothing.

hello Andreas

i was struggling with my xClarity and thinksystem system… because they are delivering only two checks over snmp “uptime and snmp info” so i find your special agent, in hope he could fetch more.

i donwloaded the mkp file and add it as an extension over the cmk GUI

i still dont really now how to use it thou? i normally find every special agent und the “other integrations” section or only by tipping the name in search bar. and than configure it.
i have a 2.1.0p9.cfe still testing the Enteprise free Edition.

Beside this you need also to install the Redfish Python module with “pip3 install redfish” as site user. This is written inside the package info.
After this and also before you should see the xClarity special agent inside the other integrations section.

This is how it looks like on my system under “Other intergrations” → “Hardware”

redfish is installed

package also

but there is nothing under hardware.

and search button doesnt find it also. i will try reinstall it.

after deleting the mkp package and installing it again, and restarting the checkmk appliance, nothing happend and still doesnt show up under the others packages.

hello, so downloaded the plugin with the 2.6 version. and he is now availble.
i configured it with giving it the username and the password. and set the agent to “Api configurend else checkmk agent” when making connections i got this error in the agent section.

Agent exited with code 1: Traceback (most recent call last):
File "/omd/sites/checkmkmo/local/share/check_mk/agents/special/agent_lenovo_xclarity", line 186, in <module>
result = get_hw_inventory(ip, login_account, login_password)
File "/omd/sites/checkmkmo/local/share/check_mk/agents/special/agent_lenovo_xclarity", line 43, in get_hw_inventory
REDFISH_OBJ = redfish.redfish_client(
File "/omd/sites/checkmkmo/local/lib/python3/redfish/rest/v1.py", line 1096, in redfish_client
return HttpClient(base_url=base_url, username=username, password=password,
File "/omd/sites/checkmkmo/local/lib/python3/redfish/rest/v1.py", line 1008, in __init__
super(HttpClient, self).__init__(base_url, username=username,
File "/omd/sites/checkmkmo/local/lib/python3/redfish/rest/v1.py", line 492, in __init__
self.get_root_object()
File "/omd/sites/checkmkmo/local/lib/python3/redfish/rest/v1.py", line 587, in get_root_object
raise ServerDownOrUnreachableError("Server not reachable, " \
redfish.rest.v1.ServerDownOrUnreachableError: Server not reachable, return code: 404

is it beacuase of the httpclient? my xClarity is reachbale under httpS://IP. if it is so how can i redirect to https

Inside the special agent you see that it is https only.

    result = {}
    login_host = "https://" + ip

    # Connect using the BMC address, account name, and password
    # Create a REDFISH object
    REDFISH_OBJ = redfish.redfish_client(
        base_url=login_host,
        username=login_account,
        password=login_password,
        default_prefix="/redfish/v1",
        cafile=utils.g_CAFILE,
    )

is it really reachable from the monitoring server?
Do a “curl -v https://IP/redfish/v1” to test the connection.

OMD[checkmkmo]:~$ curl -v https://192.168.20.12/redfish/v1
* Expire in 0 ms for 6 (transfer 0x55f9348c99d0)
*   Trying 192.168.20.12...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55f9348c99d0)
* Connected to 192.168.20.12 (192.168.20.12) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: self signed certificate in certificate chain
* Closing connection 0
curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

i got this response. it seems to have some certificate issues.

That is nearly “normal”. As most management interfaces i saw in the last 20 years had only self signed certificates. You can add the option to curl to ignore the certificate problem.

@andreas-doehler

after testing with -k and --insecure parameter

curl --insecure -v https://192.168.20.12/redfish/v1
curl -k -v https://192.168.20.12/redfish/v1

there is not certs issues but it still says HTTP ERROR 404 Not Found

OMD[checkmkmo]:~$ curl -k -v https://192.168.20.12/redfish/v1
* Expire in 0 ms for 6 (transfer 0x5602df1f89d0)
*   Trying 192.168.20.12...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x5602df1f89d0)
* Connected to 192.168.20.12 (192.168.20.12) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=US; ST=North Carolina; L=Raleigh; O=Lenovo; OU=EBG; CN=Generated by Lenovo System Management Software
*  start date: Jan  1 00:00:00 1970 GMT
*  expire date: Dec 31 23:59:59 2069 GMT
*  issuer: C=US; ST=North Carolina; L=Raleigh; O=Generated by Server Firmware; OU=; CN=LXCA
*  SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
> GET /redfish/v1 HTTP/1.1
> Host: 192.168.20.12
> User-Agent: curl/7.64.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/1.1 404 Not Found
< Date: Wed, 24 Aug 2022 08:13:08 GMT
< Set-Cookie: samlEnabled=false; Path=/; Secure; SameSite=Lax; HttpOnly;
< Cache-Control: must-revalidate,no-cache,no-store
< Content-Type: text/html;charset=iso-8859-1
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Transfer-Encoding: chunked
<
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr><th>URI:</th><td>/redfish/v1</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Not Found</td></tr>
<tr><th>SERVLET:</th><td>-</td></tr>
</table>

</body>
</html>
* Connection #0 to host 192.168.20.12 left intact

You are sure that this management interface is supporting Redfish?
Older devices don’t have the Redfish endpoint.

Hi Andreas,

wir haben den gleich fall wie @ymez .
Wir haben einen Lenovo SR650 Server. Kannst du hierzu was sagen.

Vielen Dank!

Naja ich hab keine Antwort auf den letzten Post bekommen und offensichtlich bietet das System keinen Redfish Endpoint an. Kann sich meiner Meinung nach nur um ein Konfigurationsproblem auf dem Management Interface handeln.
Wenn der SR650 einen ordentlichen XClarity Controller hat so muss er auch Redfish können.

folgendes erhalte sich, wenn ich auch die richtige IP eintrage :face_with_open_eyes_and_hand_over_mouth:

dennoch bekomme ich keine Services angezeigt!