Check HP P2000 API

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Richard_Lian
Posts: 17
Joined: Sat Apr 06, 2013 2:07 am

Re: Check HP P2000 API

Post by Richard_Lian »

Hi,

ok I will do that - thanks.

If anyone on here does come up with something though - please let us know.

Regards,

Richard
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check HP P2000 API

Post by tmcdonald »

We'll keep the thread open in case anyone does have a fix, or if you get it working and wish to report back.
Former Nagios employee
Richard_Lian
Posts: 17
Joined: Sat Apr 06, 2013 2:07 am

Re: Check HP P2000 API

Post by Richard_Lian »

Hopefully the author will reply or if anyone on here spots anything that would be helpful.

I tried posting on the authors site but my posts haven't appeared.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check HP P2000 API

Post by tmcdonald »

Posts probably need to be moderated before they show publicly. I'd give it some time.
Former Nagios employee
Richard_Lian
Posts: 17
Joined: Sat Apr 06, 2013 2:07 am

Re: Check HP P2000 API

Post by Richard_Lian »

Hi,

Not gotten a reply from the author yet but I asked a coder to take a look for me.

Basically he found that the FRU is returning some absent values which are being interpreted as "Critical". The hack or workaround is to bypass/ignore the absent values.

The actual code used for the FRU check function is below if you wish to copy it. Please note that this is not supported by the author or me, it is simply a workaround that has done the job for us. These values can't be important to us as they were not present in the firmware pre the upgrade, plus the SAN management interface does not register them which uses the same API.

Code: Select all

//Get FRU Information
								$regXML = getRequest($sessionVariable, "{$url}show/frus", $secure);
								$regXML = new SimpleXMLElement($regXML);
 
								foreach($regXML->OBJECT as $obj) {
										$attr = $obj->attributes();
										if($attr['name']== "fru") {
												// RG: Temp hack to remove empty values returned by the API.
												
												$type = (string) getEnclosureStatus($obj->PROPERTY, array('name'=>'name', 'value'=>'fru-shortname'));
												
												if ( empty($type) || $type == "" )
												{
													continue;
												}
												else
												{
													
													$statuses[$type][]= getEnclosureStatus($obj->PROPERTY, array('name'=>'name', 'value'=>'fru-status'));
												}
										}
								}
 
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Check HP P2000 API

Post by abrist »

Nice work! Thanks for the update.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
christudorache
Posts: 15
Joined: Fri Sep 19, 2014 2:32 pm

Re: Check HP P2000 API

Post by christudorache »

Sorry for the late reply, been busy here. Nice work! Thanks for the update. That worked. The problem started when I upgraded my firmware as well.
Locked