bb-Ricardo / check_redfish

A monitoring/inventory plugin to check components and health status of systems which support Redfish. It will also create a inventory of all components of a system.
MIT License
113 stars 34 forks source link

check_redfish.py does not resolve hostname #121

Closed csawyerldn23 closed 1 year ago

csawyerldn23 commented 1 year ago

Hi

check_redfish.py fails to resolve hostnames, resulting in check failure. Checks against host IP address succeed

Creds, hosts, etc. details suppressed for obvious reasons:

$ /usr/lib64/nagios/plugins/check_redfish.py --info -u -p -H [OK]: INFO: Dell Inc. PowerEdge R7XX (CPU: 2, MEM: 512GB) - BIOS: 1.9.2 - Serial: XXXXXXXXXX - ServiceTag: XXXXXX - Power: On - Name: NOT SET - 60 health sensors are in 'OK' state

$ /usr/lib64/nagios/plugins/check_redfish.py --info -u -p -H [CRITICAL]: Host 'HOSTNAME.DOMAIN' down or unreachable.

Outside of the script, hostname resolution works perfectly

Additional to this: the host's IP address and alias are defined with host_name in the .cfg config

thank you

bb-Ricardo commented 1 year ago

Hi,

Sorry but I don’t really know how to help you here troubleshooting this issue.

The plugin itself does nothing special regarding host name resolution. It uses the python-redfish library to perform all the requests.

And if the host name can be resolved by other tools then it seems a installation or environment specific issue.

I also don’t know which config you are referring to.

Did you check if there is a proxy defined within the environment?

Cheers Ricardo

csawyerldn23 commented 1 year ago

Thanks. I've worked around the issue by defining a new macro in the hosts definition that points to the system's iDrac IP rather than asking the script to resolve bmc$HOSTNAME$ (which expands to a host existent in DNS) regards

bb-Ricardo commented 1 year ago

Great that you found a solution. Can I close the ticket?

csawyerldn23 commented 1 year ago

Please do - thanks