Nagios and Cacti

Justin Ellison justin at techadvise.com
Fri Apr 23 04:11:31 CEST 2004


I can't believe I'm posting such nasty code, but, it works for me.  I
need to get around to doing some error trapping and what not, but it's
been nuts at work.

This script is used to grab traffic stats from routers, etc via SNMP,
check if it's within the critical/warning levels, and create/update an
RRD file.

You need the RRDs perl module installed from the RRD homepage, and
Net::SNMP from CPAN.

Add to checkcommands.cfg:
define command{
        command_name    check_traffic
        command_line    $USER1$/check_traffic -H $HOSTADDRESS$ -C $ARG1$
-w $ARG2$ -c $ARG3$  -i $ARG4$ -s $ARG5$
        }

Add to services.cfg for the hosts you wish to monitor:

check_command	check_traffic!rostring!warn!crit!iface!ver

where rostring is the snmp community string, warn is the percentage for
warning (ie 85 - if traffic is above 85% of total, warning is returned),
crit is critical percentage, iface is a comma separated list of
interface numbers you want to monitor corresponding to snmp .ifDescr.x,
and ver is the snmp version to use (1 or 2 only).

You'll want to edit check_traffic and change the $dbpath variable to
point to your cacti rra directory.  Also make sure that the nagios user
has write permissions into that directory.

Then, manually add the rrd files as data sources in Cacti, and viola!
pretty graphs!

Justin

On Thu, 2004-04-22 at 18:22, Thomas Guldener wrote:
> If anyone has a solution to share the data between cacti and nagios
> I’m also interested of the solution. We also use Nagios for monitoring
> and Cacti for traffic statistic.
> 
>  
> 
> Greats
> 
> Thomas
> 
>  
> 
> *********************************************************************
> Thomas Guldener                                T: +41 (0)43 388 99 99
> Network Operations Engineer                              direct 99 07
> Monzoon Networks AG                            F: +41 (0)43 388 99 88
> Riedhofstrasse 124                             M: +41 (0)76 339 93 17
> CH-8105 Regensdorf                                                  
>                                                                     
> mailto:tguldener at monzoon.net                  http://www.monzoon.net
> *********************************************************************
> ------------>> sent via monzoon secure wireless access <<------------
> 
> 
>                                    
> ______________________________________________________________________
> 
> From:nagios-users-admin at lists.sourceforge.net
> [mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Rob
> Wirtz
> Sent: Freitag, 23. April 2004 00:10
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Nagios and Cacti
> 
> 
>  
> 
> Is anyone using nagios and cacti?  I’d like to share information if
> possible.
> 
>  
> 
> Thanks.
> 
>  
> 
> Rob Wirtz CNE, MCSE
> 
> Senior Network Systems Analyst
> 
> Computing and Network Services
> 
> Kansas State University
> 
> 2323 Anderson #146
> 
> Manhattan, KS  66502
> 
> 785-532-3346
> 
> rob at ksu.edu
> 
>  
-- 
Justin Ellison <justin at techadvise.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_traffic
Type: text/x-perl
Size: 5876 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040422/a529c648/attachment.pl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040422/a529c648/attachment.sig>


More information about the Users mailing list