LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2009, 03:57 AM   #1
anaigini45
Member
 
Registered: Nov 2009
Posts: 49

Rep: Reputation: 15
Help with nagios plugins


Hi,

I've managed to get a few plugins (check_mysql_status.asc, check_mysql_conn.pl, and check_mysql_health-2.1). These are for use in Nagios to check the status of mysql server in my company's local and remote server.

check_mysql_conn.pl : perl script file
check_mysql_status.asc : script that needs to be decrypted
check_mysql_health.pl : perl script file

Now what I need is some help/guide on where to install these plugins for to me able to test/use it.
 
Old 12-14-2009, 04:17 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by anaigini45 View Post
Hi,

I've managed to get a few plugins (check_mysql_status.asc, check_mysql_conn.pl, and check_mysql_health-2.1). These are for use in Nagios to check the status of mysql server in my company's local and remote server.

check_mysql_conn.pl : perl script file
check_mysql_status.asc : script that needs to be decrypted
check_mysql_health.pl : perl script file

Now what I need is some help/guide on where to install these plugins for to me able to test/use it.
this depends. is it a remote machine?? which check methods do you use?? eg nrpe/check_by_ssh etc etc
 
Old 12-14-2009, 04:31 AM   #3
anaigini45
Member
 
Registered: Nov 2009
Posts: 49

Original Poster
Rep: Reputation: 15
I want to use the nrpe method. For both local and remote server. I want to test and run it in my local server first. Then install and make it run in the remote server.
 
Old 12-14-2009, 05:21 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by anaigini45 View Post
I want to use the nrpe method. For both local and remote server. I want to test and run it in my local server first. Then install and make it run in the remote server.
to run it locally, install the scripts in the main directory that houses all the n agios plugins /usr/local/nagios/libexec or /usr/lib/nagios/plugins/

add a line to commands.cfg for that script...there will be many examples already in the file for you to follow.
and finally define the service....possibly in the hosts.cfg? depends how you have set up.
there are also examples in there to follow.


for nrpe, you need nagios-nrpe running on the remote server and nrpe.cfg configured correctly and started. there are examples in nrpe.cfg
the nagios plugin(s) are then installed in the plugin directory on the remote server(s) and called from the main nagios server.
service needs defining on the server in the hosts.cfg file or wherever you define services.
check_nrpe needs to also be defined in the commands.cfg file.
you can also test this from command line..

./check_nrpe -H hostname -c command -a arguments

ie

./check_nrpe -H remotehost -c checkmysql.pl -a 10 20
 
Old 12-14-2009, 09:12 PM   #5
anaigini45
Member
 
Registered: Nov 2009
Posts: 49

Original Poster
Rep: Reputation: 15
I can't locate the commands.cfg and hosts.cfg. I used which commands.cfg and which hosts.cfg to locate these files, but I am returned with :

Quote:
/usr/bin/which: no hosts.cfg in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin)
Quote:
/usr/bin/which: no commands.cfg in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin)
 
Old 12-14-2009, 09:39 PM   #6
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by anaigini45 View Post
I can't locate the commands.cfg and hosts.cfg. I used which commands.cfg and which hosts.cfg to locate these files, but I am returned with :
those config files should be located in your nagios/etc folder. You can also look through your nagios.cfg file and find the directives as to where these files can be located. I believe there is another folder with example files in the nagios root folder. If you followed their guide to compile by source the root installation is normally /usr/local/nagios
 
Old 12-14-2009, 11:28 PM   #7
anaigini45
Member
 
Registered: Nov 2009
Posts: 49

Original Poster
Rep: Reputation: 15
Finally located the files...tqs.
An example of a service created in the commands.cfg file :

Quote:
# 'check_snmp' command definition
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
If I want to use the check_mysql_stats perl script, I've got to create a service in that file :

Quote:
#'check_mysql_stats' command definition
define command{
command_name check_mysql_stats
command_line $USER1$/check_mysql_stats -H $HOSTADDRESS$ $ARG1$
}
What do I have to replace for the $USER1$, $HOSTADDRESS$ and $ARG1$?
 
Old 12-15-2009, 03:29 AM   #8
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by anaigini45 View Post
Finally located the files...tqs.
An example of a service created in the commands.cfg file :



If I want to use the check_mysql_stats perl script, I've got to create a service in that file :



What do I have to replace for the $USER1$, $HOSTADDRESS$ and $ARG1$?
you dont replace $USER$1. it is already set in resource.cfg.
so hostaddress you replace in the service file, and arg1 whatever it maybe. you can find that out by running the script from the command line and checking out the options/flags it gives.

i am pretty sure for check_snmp you will need more args then you currently have. i know for a fact you will need -C (community string) -o (oid) -w (warn range) -c (critical range) at least

Last edited by centosboy; 12-15-2009 at 03:31 AM.
 
  


Reply


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
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 1 05-31-2016 08:26 AM
Nagios 3.1.2 + RHEL 5.3 You don't have permission to access /nagios/ on this server psix Linux - Server 13 08-04-2015 03:25 AM
installing check_mysql and check_mem nagios plugins williebens Linux - Networking 15 07-31-2008 07:01 PM
Nagios Daemon, PID not found but rc.nagios runs agentc0re Slackware 1 07-03-2007 03:47 PM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:56 AM.

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