passing perfdata to nrpe

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
teh0015
Posts: 59
Joined: Tue Jul 07, 2015 9:07 am

passing perfdata to nrpe

Post by teh0015 »

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;;;
teh0015
Posts: 59
Joined: Tue Jul 07, 2015 9:07 am

Re: passing perfdata to nrpe

Post by teh0015 »

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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: passing perfdata to nrpe

Post by scottwilkerson »

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.
great!

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked