LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-21-2005, 04:58 AM   #16
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Original Poster
Rep: Reputation: 30

I already have a look on it. I am having the problem on understand the syntax. That is the main issue i face on. I need some example config to let me apply in. I always have a problem to understand documentation.

Thank You for all of the help...

Any of you guys have example of using plugin? I am still having problem to check on LAN server. I only manage to check local, for swap, users, load. Dont know how to check on others server.....

This is the sample i use for nagios server...

---------------------------------------------------------------------------------
check_command check_local_swap!70%!60%

check_command check_local_load!3!4

check_command check_local_users!2!4
---------------------------------------------------------------------------------

I am looking for some example like above but check on LAN server. The above is only check on local. I am not sure wheather is because of the define in checkcommands.cfg

---------------------------------------------------------------------------------
# 'check_local_users' command definition
define command{
command_name check_local_users
command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
}

# 'check_local_load' command definition
define command{
command_name check_local_load
command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
}

# 'check_local_swap' command definition
define command{
command_name check_local_swap
command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
}
---------------------------------------------------------------------------------

Anyone have the idea, please help...
Thank You.......
 
Old 05-25-2005, 11:53 AM   #17
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
dwarf,

I don't believe you can check the swap on remote servers with the check_swap plugin. You have to use something else to achieve this task. Are you still having problems checking remote hosts with nagios? If so here are the steps:

1. Add the host in hosts.cfg
2. Make sure the plugin is defined checkcommands.cfg
3. In services.cfg, that's where you define the check for the host.
4. reload nagios and that's it.

If that doesn't help you, paste the configs above and let me take a look at it. Also, let me know the service that you want to check.


DAVID ROSS,

I have a question for you if you don't mind . Ok, I read the plugin guidelines and I still cannot get output when nagios runs my custom plugin. It just gives me (No Output!). Grrr. Below is my plugin called check_trd:

#!/bin/sh

ps -ef | grep nagios > /dev/null 2>&1
if [ $? -eq 0 ]; then
STATE_OK=0
/bin/echo "OK: Process is up\n"
fi
exit $STATE_OK

As you can see, it just checks to make sure nagios process is up and running. It does print "OK....." on STDOUT but nagios doesn't see it. It also gives me a warning when I don't believe it should as I exitted with 0 (that should return the state to be 'OK'). I don't know what I'm doing wrong. Can you please help? Thank you.

-twantrd
 
Old 05-26-2005, 01:23 PM   #18
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It could be that the server doesn't have ps or grep in it's path.

One other thing to be careful of is that grep may report itself - ie:
Code:
rossy - trigger - Thu May 26 19:16:54
~> ps -ef | grep nagios
rossy - trigger - Thu May 26 19:17:01
~> echo $?
1
rossy - trigger - Thu May 26 19:17:04
~> ps -ef | grep nagios
rossy     2797  2703  0 19:17 pts/2    00:00:00 grep nagios
rossy - trigger - Thu May 26 19:17:06
~> echo $?
0
One solution is to use:
ps -ef | grep nagios | grep -vc grep

This greps for nagios then greps for anything that isn't a grep. The other neater solution is not to display command arguments in the ps output:
ps -eo comm | grep nagios

You should really add an else statement so that it fails properly as well as opposed to getting an unknown error. One other thing to check is that it is executable by the user that nagios is running as.

dwarf007, nrpe should let you execute the command on the remote host.

Last edited by david_ross; 05-26-2005 at 01:26 PM.
 
Old 05-26-2005, 08:48 PM   #19
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Argh, this was my fault. Thanks for your help though David. The problem was that I didn't put $USER1$ in my checkcommands.cfg. That was it. Thanks again..

-twantrd
 
Old 03-16-2011, 04:02 AM   #20
dariuskav
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 0
You can check my blog of "What is Nagios and how to use it?" Check - jd-design.lt/tutorials

It's really simple basics.
 
Old 10-03-2011, 06:11 AM   #21
thambipg
LQ Newbie
 
Registered: Oct 2011
Posts: 1

Rep: Reputation: Disabled
nagios syntax

can any one reply how to check the nagios all configuration for mysql,jboss,lan,webserver,disk,cpu
 
  


Reply



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
how to apt-get mplayer-plugin (mozilla plugin)? hkl8324 Debian 2 06-29-2005 09:28 AM
Nagios: Raid Plugin kegwell Linux - Software 2 05-01-2005 11:38 AM
Nagios Plugin Compile Anarusis Linux - Software 3 04-10-2005 02:31 PM
Flash Plugin in Opera 7.11. Not showing up on plugin list even. binarynova Linux - Software 4 02-05-2004 07:21 AM
Nagios markus1982 Linux - Software 1 04-01-2003 06:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:18 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration