Page 1 of 2

no Graph when using HP 3PAR plugin

Posted: Wed Jan 21, 2015 9:08 am
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.

Re: no Graph when using HP 3PAR plugin

Posted: Wed Jan 21, 2015 11:38 am
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

Re: no Graph when using HP 3PAR plugin

Posted: Wed Jan 21, 2015 11:14 pm
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%

Re: no Graph when using HP 3PAR plugin

Posted: Thu Jan 22, 2015 1:19 am
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.

Re: no Graph when using HP 3PAR plugin

Posted: Thu Jan 22, 2015 2:41 pm
by tgriep
Let us know if this works for you. Thanks for the post Box.

Re: no Graph when using HP 3PAR plugin

Posted: Mon Feb 09, 2015 5:14 am
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.

Re: no Graph when using HP 3PAR plugin

Posted: Mon Feb 09, 2015 11:29 am
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?

Re: no Graph when using HP 3PAR plugin

Posted: Mon Feb 09, 2015 6:35 pm
by Box293
Also, please upload your modified plugin.

Re: no Graph when using HP 3PAR plugin

Posted: Tue Feb 10, 2015 4:47 am
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

Re: no Graph when using HP 3PAR plugin

Posted: Tue Feb 10, 2015 9:59 am
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...