I can't get my nrpe script to pass numerical data via nrpe - I've done this before but it's been a while so I'm guessing I'm just doing something stupid.
This counts process on a ctbd samba server.
relevant portion of the nrpe script:
connections=`smbstatus -p|grep ^1|wc -l`
echo "SMB is running |connections=$connections;;; "
exit 0
If I run this locally I get:
SMB is running |connections=95;;;
If I run it via nrpe (it's defined in the nrpe.cfg) I get
SMB is running |connections=0;;;
It seems that when I pass a numeric variable to echo it's getting converted to 0 via nrpe.
If I put in a string it comes across via nrpe.
#connections=`smbstatus -p|grep ^1|wc -l`
connections=fred
Now via nrpe I get
SMB is running |connections=fred;;;
passing perfdata to nrpe
Re: passing perfdata to nrpe
I figured it out.
My bad.
I forgot to check by logging in as the nrpe user and seeing what happens.
I did that and realized it was a permissions issue - setup sudoers and it's all going.
My bad.
I forgot to check by logging in as the nrpe user and seeing what happens.
I did that and realized it was a permissions issue - setup sudoers and it's all going.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: passing perfdata to nrpe
great!teh0015 wrote:I figured it out.
My bad.
I forgot to check by logging in as the nrpe user and seeing what happens.
I did that and realized it was a permissions issue - setup sudoers and it's all going.
Locking