LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-05-2007, 01:40 PM   #1
sparc86
Member
 
Registered: Jul 2006
Location: Joinville, Southern Brazil
Distribution: Debian, CentOS
Posts: 296

Rep: Reputation: 31
Post 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!
 
Old 04-05-2007, 04:26 PM   #2
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
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
 
Old 04-12-2007, 03:02 PM   #3
gadzooki
LQ Newbie
 
Registered: Apr 2007
Posts: 1

Rep: Reputation: 0
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
 
  


Reply

Tags
nagios


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios/nrpe: SSL Issues Killbot_5000 Linux - Security 18 09-21-2010 06:27 PM
Nagios...anyone? immortaltechnique Linux - Networking 6 12-16-2006 09:05 AM
LXer: Nagios 2.5 and Oreon 1.3 (Nagios web front end) installation with screenshots LXer Syndicated Linux News 0 08-11-2006 06:33 PM
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 0 07-18-2006 09:33 PM
Nagios markus1982 Linux - Software 1 04-01-2003 07:04 AM


All times are GMT -5. The time now is 03:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration