Page 1 of 1

Issue with check_services and NRDS

Posted: Wed Apr 04, 2018 8:45 am
by RobertWebb
So I have a default linux config working with NRDS. I am trying to add a check_services so I can monitor all the services related to IPA.

I can add it to the config I have defined but it doesn't seem to return the correct results. The service in Nagios XI shows as a status of unknown.

Running the check manually as the nagios user on the system results in the following:

/usr/local/nrdp/clients/nrds/nrds.pl -H 'hostname'
/usr/local/nagios/libexec/utils.sh: line 2: $'\r': command not found
/usr/local/nagios/libexec/utils.sh: line 8: $'\r': command not found
/usr/local/nagios/libexec/utils.sh: line 15: syntax error near unexpected token `$'{\r''
'usr/local/nagios/libexec/utils.sh: line 15: `print_revision() {
: numeric argument requiredheck_services: line 112: exit: 0
Sent 7 checks to https://fgdn/nrdp/


Here is my config:

command[__HOST__]=/usr/local/nagios/libexec/check_ping -H localhost -w 200.0,40% -c 400.0,80% -p 1
command[Check Users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[Check Load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[Check Disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
command[Check Zombie Procs]=/usr/local/nagios/libexec/check_procs -w 100 -c 150 -s Z
command[Check Total Procs]=/usr/local/nagios/libexec/check_procs -w 250 -c 300
command[Check Directory Service]=/usr/local/nagios/libexec/check_services -p 'dirsrv.service'

Running the check_services command manually by itself gives:

./check_services -p 'dirsrv'
/usr/local/nagios/libexec//utils.sh: line 2: $'\r': command not found
/usr/local/nagios/libexec//utils.sh: line 8: $'\r': command not found
/usr/local/nagios/libexec//utils.sh: line 15: syntax error near unexpected token `$'{\r''
'usr/local/nagios/libexec//utils.sh: line 15: `print_revision() {
dirsrv: 2
: numeric argument required exit: 0


A version check of the command gives:

./check_services -V
/usr/local/nagios/libexec//utils.sh: line 2: $'\r': command not found
/usr/local/nagios/libexec//utils.sh: line 8: $'\r': command not found
/usr/local/nagios/libexec//utils.sh: line 15: syntax error near unexpected token `$'{\r''
'usr/local/nagios/libexec//utils.sh: line 15: `print_revision() {
check_services - 0.01.1
: numeric argument requiredexit: 0

Re: Issue with check_services and NRDS

Posted: Wed Apr 04, 2018 9:33 am
by RobertWebb
SO this is still an issue for the check_service script, but I moved to the check_init_service script for monitoring my services.

Re: Issue with check_services and NRDS

Posted: Wed Apr 04, 2018 2:33 pm
by scottwilkerson
RobertWebb wrote:SO this is still an issue for the check_service script, but I moved to the check_init_service script for monitoring my services.
It sounds like the script has a problem, possible with DOS/Windows line ending

Can you attach it if you still want to use it?