Nagios 2240 + Check-Nagios-NG.pl + Configuration

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.
futurist71
Posts: 12
Joined: Mon Jul 14, 2014 2:59 pm

Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by futurist71 »

I'm having troubles implementing Nagios to monitor Netapp 2240.

- STEP 1 -
Download check-nagios-ng.pl and place it /usr/local/nagios/libexec/

#chmod +x check-Nagios-ng.pl

- STEP 2 -
# perl -MCPAN -e shell

cpan> install Net::SNMP

- STEP 3 -
(modifiy commands.cfg)

define command{
command_name check_netapp_cpu
command_line /usr/bin/perl5.8.8 $USER1$/check-netapp-ng.pl -H $HOSTADDRESS$ -T CPULOAD -w 80 -c 90 -C public
}

define command{
command_name check_netapp_fan
command_line /usr/bin/perl5.8.8 $USER1$/check-netapp-ng.pl -H $HOSTADDRESS$ -T FAN -w 1 -c 3 -C public
}


- STEP 4 -
(modifiy windows.cfg)

define service{
use generic-service
host_name FILER1
service_description CPU Load
check_command check_netapp_cpu
}

define service{
use generic-service
host_name FILER1
service_description Fan Fail
check_command check_netapp_fan
}

- STEP 5 -

# services nagios restart

- ERROR RECEIVED AFTER RESTARTING SERVICES -

Error: Could not find any host matching 'FILER1' (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 384)
Error: Failed to expand host list 'FILER1' for service 'Fan Fail' (/usr/local/nagios/etc/objects/windows.cfg:384)
Error processing object config files!

What could be happening? Thanks in advanced.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by tmcdonald »

It looks like you do not have a FILER1 host defined anywhere. Is this the case?
Former Nagios employee
futurist71
Posts: 12
Joined: Mon Jul 14, 2014 2:59 pm

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by futurist71 »

Where do I have to define it? For Windows Servers I just specify the HOST NAME as it is on my interl DNS and it retrieve the proper data, Where do I have to define FILER1?

Regards.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by tmcdonald »

You need to create a definition for the host the same way you did for the service, like so (example):

Code: Select all

define host {
	use		generic-host		; Inherit default values from a template
	host_name		remotehost		; The name we're giving to this host
	alias		Some Remote Host	; A longer name associated with the host
	address		192.168.1.50		; IP address of the host
	hostgroups		allhosts		; Host groups this host is associated with
}
The host_name here should be FILER1 and the address can be an IP or the DNS name.
Former Nagios employee
futurist71
Posts: 12
Joined: Mon Jul 14, 2014 2:59 pm

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by futurist71 »

After doing what you are telling me and restart Nagios Service, this is what I get:

Error: Invalid max_check_attempts value for host 'FILER1'
Error: Could not register host (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 33)
Error processing object config files!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by slansing »

You will need to make sure that you have all the basic/required configuration options defined, you can see them here outlined in red:

http://nagios.sourceforge.net/docs/3_0/ ... .html#host

Further down on that page, you can find out what each individual option does, what it means, and different ways of defining it. Make sure to verify your configurations prior to restarting to see what might be missing via the errors it would spit out:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
^--- CENTOS/RHEL example.
futurist71
Posts: 12
Joined: Mon Jul 14, 2014 2:59 pm

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by futurist71 »

OK. Thanks! I finally ran the service.
But now on Nagios Portal I'm getting this error as a result. What could be happening?

No output on stdout) stderr: execvp(/usr/bin/perl5.8.8, ...) failed. errno is 2: No such file or directory
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by slansing »

Okay, so lets take a step back here, and rather than editing the configurations hoping to get the check right, lets test it the easiest way. From the command line, what is the output of:

Code: Select all

/usr/bin/perl5.8.8 /path/to/your/check-netapp-ng.pl -H host.addr.of.remote.host -T CPULOAD -w 80 -c 90 -C public 
Was there a specific guide you used to set this plugin up? Usually the path to perl is included in the perl script itself to keep it cleaner.
futurist71
Posts: 12
Joined: Mon Jul 14, 2014 2:59 pm

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by futurist71 »

Hi again,

Last error reported is related to the Perl version referenced when setting up the command.

Version installed on my CentOS Server was 5.10.1 and the one from the code I was checking was perl5.8.8, I just changed the numbers and service is already running.

And yes, I first check using commands directly, and results are displayed correctly.

Regards.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios 2240 + Check-Nagios-NG.pl + Configuration

Post by tmcdonald »

So from what I understand it is working correctly now? Or are you still seeing errors after changing the version?
Former Nagios employee
Locked