How to integration HP OneView with Nagios.

Discuss new project and feature ideas here.
See for new projects under development.

How to integration HP OneView with Nagios.

Postby DagS » Thu Mar 07, 2019 10:53 am

Need to monitor HP OneView server hardware components.

I have 160 plus servers to monitor for HP OneView. I created plugin to monitor all servers, I am reading all server from HP OneView and putting into list and iterating the list and adding check for that but after first server check it will exist from script.
Please refer the below python script(plugin):

res = requests.request("GET", server_details_url, headers=headers, verify=False)

serverList = res.json()['members']

for server in serverList:
uuid = server['uuid']
url = base_url + '/server-hardware/'"%s"%uuid+'/utilization?fields=CpuUtilization'
res = requests.request("GET", url, headers=headers, verify=False)

if res.status_code != 200:
print 'Status Code:'+str(res.status_code)

metricList = res.json()['metricList']

hpOneView_CpuUtil = metricList[0]['metricSamples'][0][1]

hpOneView_CpuUtil_Float = float(hpOneView_CpuUtil)
hpOneView_CpuUtil_display = ("%.1f" % hpOneView_CpuUtil_Float)

critical_value = 90.0
warning_value = 80.0

if hpOneView_CpuUtil_Float >= critical_value:
print "CPU last min avg at " + hpOneView_CpuUtil_display + '% CRITICAL'
elif hpOneView_CpuUtil_Float >= warning_value:
print "CPU last min avg at " + hpOneView_CpuUtil_display + '% WARNING'
elif hpOneView_CpuUtil_Float < warning_value:
print "CPU last min avg at " + hpOneView_CpuUtil_display + '% OK'
print 'Script error near line 66'

Is it possible to check all severs using single plugin?
-If yes, so how can we pass all server to single plugin.
-If no, means we need to create 2 plugin 1st for reading the server and 2nd for pass single sever and monitor, then how to add both file in Nagios for monitor.
Posts: 1
Joined: Tue Feb 05, 2019 4:12 am

Re: How to integration HP OneView with Nagios.

Postby npolovenko » Thu Mar 07, 2019 5:46 pm

Hello, @DagS. Yes, it is possible to monitor all servers using one plugin. Please refer to this tutorial on how to upload plugins to NagiosXI, create custom commands and assign these commands to the new host checks:
Let me know if you have any questions.
You'd need to create 160 host check definitions. There are many ways to do that including bulk mod tool, importing configs, cloning hosts and running an autodiscovery wizard to scan IP range and automatically add 160 hosts.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
Support Tech
Posts: 3318
Joined: Mon May 15, 2017 5:00 pm

Return to Nagios Ideas

Who is online

Users browsing this forum: No registered users and 2 guests