HP 3PAR storage monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
uertti1
Posts: 6
Joined: Wed Dec 14, 2016 6:54 am

HP 3PAR storage monitoring

Post by uertti1 »

Hello,

I have a problem withc check_3par plugin when i want to use it it dispays information:
./check_3par.sh: line 50: $'\r': command not found
./check_3par.sh: line 354: syntax error: unexpected end of file
Can somebody explain me what should I do? For me code looks good but I'm useless in programing.

I will be greatfull for help :)
uertti1
Posts: 6
Joined: Wed Dec 14, 2016 6:54 am

Re: HP 3PAR storage monitoring

Post by uertti1 »

Ok.
I solved problem which won't let me restart ganios but now I have 7 more problems because of checks:
It is how it looks:
Image
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: HP 3PAR storage monitoring

Post by mcapra »

How was this plugin put on the Nagios XI server? That looks like there may be some encoding issues within the file.

You might try running the plugin through dos2unix:
http://linuxcommand.org/man_pages/dos2unix1.html

You could also try copying the plugin's contents and pasting them into a fresh file with vi/vim.
Former Nagios employee
https://www.mcapra.com/
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: HP 3PAR storage monitoring

Post by rkennedy »

Also, in addition to what @mcapra posted - I believe it could be the variables being passed to Nagios, could you show us the complete command / service related definition?
Former Nagios Employee
uertti1
Posts: 6
Joined: Wed Dec 14, 2016 6:54 am

Re: HP 3PAR storage monitoring

Post by uertti1 »

I didn't put plugin on by web interface. I did it manually by creating plugin file via "vi" command and changing commands.cfg file.
# check_ps : Check Power Supply Node and Cage
# Degraded -> Warning
# Failed -> Critical
HERE IS LINE 50<---------------------------------------------------------------------------------
if ["$1" == "" ] || [ $2 == "" ] || [ $3 == "" ]
then
echo Invalid usage : check_3par InServ Username/passwordfile Command
exit 3
fi

INSERV=$1
USERNAME=$2
COMMAND=$3
TMPDIR=/usr/local/nagios/libexec
PCCRITICALFC=90
PCWARNINGFC=80
PCCRITICALNL=90
PCWARNINGNL=80
Here are my commands and services files.
http://textuploader.com/ddm9l
http://textuploader.com/ddm9q
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: HP 3PAR storage monitoring

Post by rkennedy »

Are you using SSH or the CLI to communicate with your 3par device? I would take a look at this document which should help to fill the missing links - https://exchange.nagios.org/components/ ... 0&cf_id=29
Former Nagios Employee
uertti1
Posts: 6
Joined: Wed Dec 14, 2016 6:54 am

Re: HP 3PAR storage monitoring

Post by uertti1 »

Ahh... Of course sorry. I should say about it earlier. Of course I'm trying to use SSH, and I can connect to storage by ssh from nagiosXI server.
I read this document while I was including 3par plugin configuration on nagios.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: HP 3PAR storage monitoring

Post by rkennedy »

Can you run the command correctly from the CLI?

Code: Select all

/usr/local/nagios/libexec/check_3par <iphere>
(replace <iphere>)

If that fails, please post the entire check_3par script for us to review.
Former Nagios Employee
uertti1
Posts: 6
Joined: Wed Dec 14, 2016 6:54 am

Re: HP 3PAR storage monitoring

Post by uertti1 »

This is what apears when I'm trying to use check command
[root@nagioss libexec]# /usr/local/nagios/libexec/check_3par <iphere>
/usr/local/nagios/libexec/check_3par: line 50: $'\r': command not found
/usr/local/nagios/libexec/check_3par: line 354: syntax error: unexpected end of file
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: HP 3PAR storage monitoring

Post by rkennedy »

If that fails, please post the entire check_3par script for us to review.
We'll need to take a look at it.
Former Nagios Employee
Locked