it been a while since I configure nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

it been a while since I configure nagios

Post by spyder13337 »

I know it be a while since I use nagios but I am not sure it config properly perhaps you can give me a quick look over

is this correct

Serverside :
nrpe.cfg
command[check_freeswitch]=/usr/local/nagios/libexec/check_freeswitch -q show-calls-count

command.cfg

'check_freeswtich' command definition

define command{
command_name check_freeswitch
command_line $USER1$/check_freeswitch -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$

service.cfg

define service {
use generic-service
service_description FreeSWITCH Call Count
check_command check_freeswitch! -q show-calls-count

Client :
nope.cfg
command[check_freeswitch]=/usr/local/nagios/libexec/check_freeswitch -q show-calls-count
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: it been a while since I configure nagios

Post by scottwilkerson »

Does check_freeswitch connect directly from the nagios server or are you installing it on the client with the NRPE configs you showed?

It all looks right to me if it is on the client except you should change the following


service.cfg

Code: Select all

define service {
use generic-service
service_description FreeSWITCH Call Count
check_command check_nrpe!check_freeswitch
also the definition in command.cfg is not necessary
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

Re: it been a while since I configure nagios

Post by spyder13337 »

the command show run from the client side under NRPE
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: it been a while since I configure nagios

Post by scottwilkerson »

Did you make the recommended changes to the command I suggested then?
scottwilkerson wrote: It all looks right to me if it is on the client except you should change the following

service.cfg

Code: Select all

define service {
use generic-service
service_description FreeSWITCH Call Count
check_command check_nrpe!check_freeswitch
also the definition in command.cfg is not necessary
After making the changes, restart nagios
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

Re: it been a while since I configure nagios

Post by spyder13337 »

yes I did and restart both nrpe and nagios

result still the same if I run the command on client it get the expected result if I run it from

this is the common I run from nagios server to test (I get invalid option -q )

/usr/local/nagios/libexec/check_nrpe -H xx.xx.xx.xx -c check_freeswitch -q 'show-calls-cout'

on. client side I run

/usr/local/nagios/libexec/check_freeswitch -q show-calls-count

FREESWITCH OK - Result of check is: 25 total. | show-calls-count=25;;

these are the correct value that it should return
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: it been a while since I configure nagios

Post by scottwilkerson »

change this

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H xx.xx.xx.xx -c check_freeswitch -q 'show-calls-cout' 
To this

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H xx.xx.xx.xx -c check_freeswitch
You already have -q 'show-calls-cout' in the command on NRPE and that's not how you would pass arguments anyways
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

Re: it been a while since I configure nagios

Post by spyder13337 »

ok thanks for the feedback how can I pass the augment correctly then .
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: it been a while since I configure nagios

Post by scottwilkerson »

If you had arguments specified in your NRPE file like so

Code: Select all

command[check_freeswitch]=/usr/local/nagios/libexec/check_freeswitch -q show-calls-count $ARG1$
You could then call nrpe like so

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H xx.xx.xx.xx -c check_freeswitch -a '-vvv'
And it would be passed to NRPE and this is what would be executed on the remote system

Code: Select all

/usr/local/nagios/libexec/check_freeswitch -q show-calls-count -vvv
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked