|
|
| Author |
Message |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5392 Location: Wisconsin, USA
|
Posted: Thu Aug 03, 2006 8:37 pm Post subject: Nagios plugin to monitor Cacti log |
|
|
Well, I was on a kick to write a shell script monitor a Cacti server, I figure I might as well write a nagios plugin to monitor the Cacti log.
Parameters can be set from command line or by editing the script.
| Code: | Cacti log monitoring plugins for Nagios
Copyright (C) 2006 The Cacti Group
Syntax:
cacti_log_check.sh <Path> <Warn> <Critical> <Interval>
<Path> - Path to Cacti log file, default:
/var/www/htdocs/cacti/log/cacti.log
<Warn> - Size to alert warning in bytes, default: 536870912
<Critical> - Size to alert critical in bytes, default: 1073741824
<Interval> - Polling interval in seconds, default: 300
|
Questions, concerns, comments, let me know!
| Description: |
| Nagios Plugin for monitoring Cacti log |
|
 Download |
| Filename: |
cacti_log_check.sh |
| Filesize: |
4.69 KB |
| Downloaded: |
795 Time(s) |
|
|
| Back to top |
|
 |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5392 Location: Wisconsin, USA
|
Posted: Fri Aug 04, 2006 12:27 pm Post subject: |
|
|
| Also should note, if you are using Cacti not on the same machine as Nagios, I would suggest using NRPE to use the plugin on the Cacti server.
|
|
| Back to top |
|
 |
knobdy Cacti User
Joined: 28 Sep 2005 Posts: 495
|
Posted: Tue Sep 12, 2006 12:43 pm Post subject: |
|
|
I'm thinking this goes into services.cfg - so what is the format one should use for the check_command? Whatabout the checkcommands.cfg file?
I've edited the script for my system and can run it correctly from the command line (just running it) but Nagios is showing:
| Code: | | Check Cacti service UNKNOWN 09-12-2006 12:37:00 0d 1h 1m 41s 3/3 CACTI UNKNOWN: Log file not found |
|
|
| Back to top |
|
 |
knobdy Cacti User
Joined: 28 Sep 2005 Posts: 495
|
Posted: Mon Sep 18, 2006 2:30 pm Post subject: |
|
|
| So, any news on this? I haven't yet been able to get Nagios to work with this script - via Nagios (run manually, again, it reports everything OK). I think its just an issue with my configuration of the service in the config file - so perhaps just an example of your setup?
|
|
| Back to top |
|
 |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5392 Location: Wisconsin, USA
|
Posted: Mon Sep 18, 2006 5:28 pm Post subject: |
|
|
| Are you running the plugin on the same server that Cacti is installed on? Does the user that nagios is running as have access to the Cacti log file?
|
|
| Back to top |
|
 |
knobdy Cacti User
Joined: 28 Sep 2005 Posts: 495
|
Posted: Tue Sep 19, 2006 8:29 am Post subject: |
|
|
| It is on the same server and the cacti log file is RW for user and group - the group is "users" and nagios is in that group.
|
|
| Back to top |
|
 |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5392 Location: Wisconsin, USA
|
Posted: Tue Sep 19, 2006 9:09 am Post subject: |
|
|
| In your nagios services configuration, surround the path on the service check with single quotes.
|
|
| Back to top |
|
 |
Hiney Cacti User
Joined: 16 Oct 2006 Posts: 55
|
Posted: Wed Feb 28, 2007 12:49 am Post subject: setup |
|
|
someone asked what to do with the checkcommands.cfg
I added
define command{
command_name check-cacti-log
command_line $USER1$/cacti_log_check.sh
}
i added the following to the server.cfg file
# Define a service to check the cacti log
define service{
use generic-service ; Name of service template to use
host_name <server>
service_description Cacti log
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,c,r
notification_interval 1440
notification_period daytime
check_command check-cacti-log
}
Last edited by Hiney on Wed Feb 28, 2007 5:34 pm; edited 1 time in total |
|
| Back to top |
|
 |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5392 Location: Wisconsin, USA
|
Posted: Wed Feb 28, 2007 9:48 am Post subject: |
|
|
Thanks, I don't have a Nagios installation to test on and haven't used it in years..
|
|
| Back to top |
|
 |
prune
Joined: 11 Sep 2005 Posts: 23 Location: Paris, France
|
Posted: Fri Aug 03, 2007 7:05 am Post subject: |
|
|
Hi,
I made a post some time ago, but this is an update.
I made a patch to threshold plugin so the alert can be passed to Nagios as a passive check.
Feel free to check and download it from my blog :
http://www.lecentre.net/blog/archives/77
If your Nagios install is on a remote host, change the script to send the alarm by scp or ssh.
Hope this can help
|
|
| Back to top |
|
 |
|