no Graph when using HP 3PAR plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
itsupport_sgp
Posts: 19
Joined: Fri Aug 15, 2014 12:06 am

no Graph when using HP 3PAR plugin

Post by itsupport_sgp »

Hi,

Does anyone know how to configure HP 3PAR plugin?
Currently, I have use the HP 3PAR plugin found in the Nagios library but unfortunately it is not able to display any graph representation.
Our objective is to have 3PAR monitoring with graph such as disk utilisation, IOPS and etc..
Then we will use the capacity planning to generate the report.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: no Graph when using HP 3PAR plugin

Post by lmiltchev »

Does the plugin return perfdata? Not all of the plugins do. Can you show us the actual command that you are running in the command line, along with the output of it?

You can learn more about the perfdata, returned from nagios plugins by reviewing the nagios plugin development guidelines here:

https://nagios-plugins.org/doc/guidelines.html#AEN200
Be sure to check out our Knowledgebase for helpful articles and solutions!
itsupport_sgp
Posts: 19
Joined: Fri Aug 15, 2014 12:06 am

Re: no Graph when using HP 3PAR plugin

Post by itsupport_sgp »

lmiltchev wrote:Does the plugin return perfdata? Not all of the plugins do. Can you show us the actual command that you are running in the command line, along with the output of it?

You can learn more about the perfdata, returned from nagios plugins by reviewing the nagios plugin development guidelines here:

https://nagios-plugins.org/doc/guidelines.html#AEN200
I get it on why I don't have the perfdata now but how can I have it setup using the 3par plugin attached?

command
check_3par_cap_nl!3paradm!!!!!!!

Sample output
OK : Used NL capacity = 58%
You do not have the required permissions to view the files attached to this post.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: no Graph when using HP 3PAR plugin

Post by Box293 »

So the plugin clearly does not output performance data.

Anything following the pipe symbol | is treated as performance data.

Here is how performance data needs to be structured for Nagios to recognise it:
https://nagios-plugins.org/doc/guidelines.html#AEN200

Code: Select all

'label'=value[UOM];[warn];[crit];[min];[max]
To take the check you are currently providing as an example, this appears to be the check_cap_nl check.

Now the way the check is written, you will need to add this code to three separate lines (387, 393, 397):

Code: Select all

|'Used NL capacity'=$USEDCAPPCNL\%;$PCWARNINGNL;$PCCRITICALNL
So it will end up looking like this:

Code: Select all

 if [ $USEDCAPPCNL -ge $PCCRITICALNL ]
        then
                echo CRITICAL! Used NL capacity = $USEDCAPPCNL\% \( \> $PCCRITICALNL\% \) |'Used NL capacity'=$USEDCAPPCNL\%;$PCWARNINGNL;$PCCRITICALNL
                rm -f $TMPDIR/3par_$COMMAND.$INSERV.out
		exit 2
        else
                if [ $USEDCAPPCNL -ge $PCWARNINGNL ]
                then
                        echo WARNING! Used NL capacity = $USEDCAPPCNL\% \( \> $PCWARNINGNL\% \) |'Used NL capacity'=$USEDCAPPCNL\%;$PCWARNINGNL;$PCCRITICALNL
                        rm -f $TMPDIR/3par_$COMMAND.$INSERV.out
			exit 1
                else
                        echo OK : Used NL capacity = $USEDCAPPCNL\% |'Used NL capacity'=$USEDCAPPCNL\%;$PCWARNINGNL;$PCCRITICALNL
                        rm -f $TMPDIR/3par_$COMMAND.$INSERV.out
			exit 0
                fi
        fi
And the output will be something like this:

Code: Select all

OK : Used NL capacity = 58% |'Used NL capacity'=58%;80;90
Just to be clear, this will only add performance data for the check_cap_nl check. You will need to do similar to other checks for them to produce performance data.

Just to comment, the beginning of the script shows the last update was 2014/05/07, so you might be able to email the author and request them to update the script so it outputs performance data.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: no Graph when using HP 3PAR plugin

Post by tgriep »

Let us know if this works for you. Thanks for the post Box.
Be sure to check out our Knowledgebase for helpful articles and solutions!
riconeo
Posts: 35
Joined: Mon Oct 14, 2013 8:32 am

Re: no Graph when using HP 3PAR plugin

Post by riconeo »

Hi, when I update the parameters as advised.
I hit the below error:

"(No output on stdout) stderr: /usr/local/nagios/libexec/check_3par: line 397: Used NL capacity=59%: command not found"
Box293 wrote:So the plugin clearly does not output performance data.

Anything following the pipe symbol | is treated as performance data.

Here is how performance data needs to be structured for Nagios to recognise it:
https://nagios-plugins.org/doc/guidelines.html#AEN200

Code: Select all

'label'=value[UOM];[warn];[crit];[min];[max]
To take the check you are currently providing as an example, this appears to be the check_cap_nl check.

Now the way the check is written, you will need to add this code to three separate lines (387, 393, 397):

Code: Select all

|'Used NL capacity'=$USEDCAPPCNL\%;$PCWARNINGNL;$PCCRITICALNL
So it will end up looking like this:

Code: Select all

 if [ $USEDCAPPCNL -ge $PCCRITICALNL ]
        then
                echo CRITICAL! Used NL capacity = $USEDCAPPCNL\% \( \> $PCCRITICALNL\% \) |'Used NL capacity'=$USEDCAPPCNL\%;$PCWARNINGNL;$PCCRITICALNL
                rm -f $TMPDIR/3par_$COMMAND.$INSERV.out
		exit 2
        else
                if [ $USEDCAPPCNL -ge $PCWARNINGNL ]
                then
                        echo WARNING! Used NL capacity = $USEDCAPPCNL\% \( \> $PCWARNINGNL\% \) |'Used NL capacity'=$USEDCAPPCNL\%;$PCWARNINGNL;$PCCRITICALNL
                        rm -f $TMPDIR/3par_$COMMAND.$INSERV.out
			exit 1
                else
                        echo OK : Used NL capacity = $USEDCAPPCNL\% |'Used NL capacity'=$USEDCAPPCNL\%;$PCWARNINGNL;$PCCRITICALNL
                        rm -f $TMPDIR/3par_$COMMAND.$INSERV.out
			exit 0
                fi
        fi
And the output will be something like this:

Code: Select all

OK : Used NL capacity = 58% |'Used NL capacity'=58%;80;90
Just to be clear, this will only add performance data for the check_cap_nl check. You will need to do similar to other checks for them to produce performance data.

Just to comment, the beginning of the script shows the last update was 2014/05/07, so you might be able to email the author and request them to update the script so it outputs performance data.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: no Graph when using HP 3PAR plugin

Post by lmiltchev »

Hi, when I update the parameters as advised.
I hit the below error:
"(No output on stdout) stderr: /usr/local/nagios/libexec/check_3par: line 397: Used NL capacity=59%: command not found"
Do you see this error in the CLI or in the web UI? Can you show us the actual command that you are running from the command line along with the output of it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: no Graph when using HP 3PAR plugin

Post by Box293 »

Also, please upload your modified plugin.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
riconeo
Posts: 35
Joined: Mon Oct 14, 2013 8:32 am

Re: no Graph when using HP 3PAR plugin

Post by riconeo »

Hi,

I have attached the screenshot and the check_3par script.

Here is the output from Nagios CLI:

After adding the suggested piping, there is no output:
[root@sgpnagios ~]# su nagios
[nagios@sgpnagios root]$ /usr/local/nagios/libexec/check_3par 10.198.159.73 3paradm check_3par_cap_nl

After removing the suggested piping, there is output:
[nagios@sgpnagios root]$ /usr/local/nagios/libexec/check_3par 10.198.159.73 3paradm check_cap_nl
OK : Used NL capacity = 49%

Thanks a lot for all the help on this.

Regards,
Rico
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: no Graph when using HP 3PAR plugin

Post by scottwilkerson »

I looked at the plugin and I believe the problem was that the strings being echo'd were not in quotes. this may be fine for some strings, but once you add a pipe, bash is going to try to redirect output.

I edited the pligin and am posting below, however do not have the equipment to test it...
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked