Cacti.pm (OO Perl module to allow adding Cisco graphs)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
NeoCode

Cacti.pm (OO Perl module to allow adding Cisco graphs)

Post by NeoCode »

OK, I realize this is only going to be useful to a select few people, and there is a lot more stuff hardcoded in it than I would like, but I'm hoping this gets a ball rolling that I have been waiting on for a long time. Some kind of perl-based connectivity to the Cacti database is needed to simplify Cacti administration from the command line.

http://www.neocodesolutions.com/modules/Cacti/Cacti.pm

Current limitations (there are many):
  • * Only tested with Cacti 0.8.4
    * Pretty darn fragile at the moment
    * Many values are hard-coded right now -- designed to add devices monitoring interface index 1 using 64 bit counters via SNMPv2
    * Developed by doing addition of a host, data source, and graph using the web UI and doing diffs of the database before and after the addition.
To do (if/when I get some spare time):
  • * Add support for additional parameters and access methods to list available templates, hosts, etc on the server -- this should allow for the caller to actually do more than what has been hard-coded thus far. :D
Usage:

Code: Select all


#!/usr/bin/perl -w
use strict;
use Cacti;

my $cacti = Cacti->new(-server => 'localhost',
                       -user => 'cactiuser',
                       -pass => 'cactipass',
                      );
$cacti->add_host(
                 -hostname => '127.0.0.1',
                 -description => 'SomeDescription',
                 -community => 'public',
                );
neorants
Posts: 1
Joined: Wed Nov 19, 2003 3:39 pm

Created account

Post by neorants »

OK, I went ahead and created an account now -- been lurking for far too long. :)
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

bump for larry/ian.

this looks like a great idea, especially to start adding batch devices and stuff.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Web site is locked down. Can't get to the PM file.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

We are currently moving to an API format in version 0.8.7. This give the abbility for people to write utitlities by just including the correct files. Granted it's only php, not perl, but you could write a command line utitlity to add/edit/remove graphs, devices, datasources, etc. The options are endless.

If you are curious, check out the api* files in the lib directory in the CVS.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
MagnaChef
Cacti User
Posts: 164
Joined: Tue Nov 25, 2003 3:58 pm
Location: Buffalo, NY

Post by MagnaChef »

I'd like to see the Cacti.pm on CPAN. :D
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests