LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Nagios issues. (https://www.linuxquestions.org/questions/linux-server-73/nagios-issues-543602/)

sparc86 04-05-2007 12:40 PM

Nagios issues.
 
Hi folks

I've been studying and testing Nagios (a monitoring network system) since 2 weeks. I've read the full official documentation and also a lot of mailing-lists.
I got lots of progress but I still feel a lack of information (even at the official docs).

For example:


Quote:

#Monitoring Memory Usage

#The following service definition will monitor memory usage on the Windows server and generate a CRITICAL alert if memory usage is 90% or more or a WARNING alert if memory usage is 80% or greater.

define service{
use generic-service
host_name winserver
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}


1.How can I remember all these parameters (MEMUSE, USEDDISKSPACE,CPULOAD...) without any documentation?
Even if I do ./check_nt, I cannot see any parameter related to MEMUSE, USEDDISKSPACE, CPULOAD or whatever...

1.What is the meaning of "!" ?


3. What exactly are these "ARGs"? Variables, I know, but with what is it associated?

Quote:

# 'check_local_disk' command definition
define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}


Thanks in advance! :jawa:

asommer 04-05-2007 03:26 PM

From my understanding the arg variables:

Quote:

$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
Are replaced with what's in your service definition:

Quote:

check_nt!MEMUSE!-w 80 -c 90
If you want to see the options for a check command use --help:

Quote:

./check_nt --help
I believe that check_nt needs the NSClient program running on your Windows Servers. The !MEMUSE! is the name of the service you want to check.

This two part article really helped me understand Nagios:

http://www.onlamp.com/pub/a/onlamp/2...05/nagios.html
http://www.onlamp.com/pub/a/onlamp/2...26/nagios.html

gadzooki 04-12-2007 02:02 PM

You will have to create an entry in your checkcommands.cfg file to use the optional switches for MEMUSE. The same goes for other optional features. It's easier to just create a series of NSC commands that you can call from your other config files. Here's a series of entries I've created in my checkcommands.cfg file:

# NsClient commands
# Command to check diskspace
define command{
command_name check_nt_disk
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v USEDDISKSPACE -l $ARG1$ -w $ARG2$ -c $ARG3$
}

# Command to check a service
define command{
command_name check_nt_service
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v SERVICESTATE -l $ARG1$
}

define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}

define command{
command_name check_nt_cpuload
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v CPULOAD -l $ARG1$
}

define command{
command_name check_nt_memuse
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v MEMUSE -w $ARG1$ -c $ARG2$
}

and here's a few examples of the service checks I created to run these commands:

# Service definition
define service{
use generic-service

host_name nm-build1-w2k
service_description uptime on nm-build1-w2k
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups build-admins
notification_interval 120
notification_period workhours
notification_options c,r
check_command check_nt!UPTIME
}

# Service definition
define service{
use generic-service
host_name nm-build1-w2k
service_description C:\ on nm-build1-w2k
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups build-admins
notification_options w,c,r
notification_interval 960
notification_period 24x7
check_command check_nt_disk!C!90%!95%
}

# Service definition
define service{
use generic-service
host_name nm-build1-w2k
service_description D:\ on nm-build1-w2k
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups build-admins
notification_options w,c,r
notification_interval 960
notification_period 24x7
check_command check_nt_disk!D!90%!95%
}

# Service definition
define service{
use generic-service
host_name nm-build1-w2k
service_description CPU Load on nm-build1-w2k
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups build-admins
notification_options w,c,r
notification_interval 960
notification_period 24x7
check_command check_nt_cpuload!10,90,95,30,90,95
}

# Service definition
define service{
use generic-service
host_name nm-build1-w2k
service_description Memory Usage on nm-build1-w2k
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups build-admins
notification_options w,c,r
notification_interval 960
notification_period 24x7
check_command check_nt_memuse!80!90
}


By setting up your checkcommands.cfg file correctly with the options and arguments laid you can create a check_command line that is easily understood. Read the doc for adding entries to checkcommands.cfg, and test each command sequence manually to understand your arguments before updating your config files.

Good luck, you'll do fine I'm sure.

Ben


All times are GMT -5. The time now is 08:07 AM.