Creating new input methods and (data,graph,host) templates

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

Moderators: Developers, Moderators

Post Reply
luke404
Posts: 6
Joined: Thu Oct 08, 2009 4:41 am

Creating new input methods and (data,graph,host) templates

Post by luke404 »

We want to use Cacti to monitor some remote machinery. It's some 2+ years that I'm using cacti for the usual stuff (network interfaces, disk space, systems load, etc... via SNMP) but it's the first time I'm trying to build a whole new set of input method - templates - graphs - and so on, any help would be appreciated. I'm fluent in python and can understand/write php with some patience :roll:

Abstract:
- there are some (4 a.t.m., could increase) kinds of remote machinery we want to monitor
- every kind has its interface card that outputs human-readable web pages with the data, for an operator to check 'live'
- web pages are different for every kind of system
- we port-forwarded tcp ports of the public IP to the http port of the monitoring cards
- data we're interested in is distributed on usually two or three web pages
- we want to generate a couple of different graphs out of the data (think about stuff like voltage values, temperatures, load %, and so on)
- keep adding and removing systems from cacti as simple as possible
- I've already written and tested some python scripts (one for each type of card, they all output different web pages) that, given hostname and port, could read the data and present it in cacti-friendly form (foo:1.2 bar:3000 baz=45.6 ....)
- I've installed Cacti-0.8.7g, with official patches and Plugin Architecture v2.8, db on MySQL-5.1. The system is 'empty' and dedicated only to this stuff.
- standard RRDs and 5 minute polling is ok

My current plan:
- data input methods: the script has to get all the web pages and parse them to get data, so it'll output all the data at once (15~20 fields). I've added a single data input method for every different script (--> one for every different remote system)
- data templates: if I understand correctly, every data template I add and eventually use to build data sources will get me one .rrd file with relevant fields, but that also means multiple (redundant) calls to the data input method that could collect all data at once. The fetching part is somewhat slow and I'd like to do it just once every poll interval. I think I should I write a single data template with all data source items in order to get a single call to my script - is that correct? When I go and create the data source, Cacti correctly asks me for the tcp port to use (AFAIK there isn't any way to specify it when adding the device, right?), build the rrd file and starts getting data into it (tested manually looking into the file with rrdtool)

And this is where I get lost!
- graph templates: Every time I try to add graphs to an host, Cacti creates a new data source for every graph!
How am I supposed to let Cacti create graphs referencing the single data source?

Basically my target is:
- login as admin to cacti
- choose to add a new device
- choose correct host template for that device type
- input once the ip address and port
- have the device in cacti, with a single script invocation every 5 minutes to poll data, with different graphs out of that data
and when I de-commission that system:
- login as admin to cacti
- choose to delete the device
- cacti asks me if I want to remove all associated Graph(s) and Data Source(s), I say yes
- everything about that system is gone
Luca
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Re: Creating new input methods and (data,graph,host) templat

Post by Linegod »

luke404 wrote: And this is where I get lost!
- graph templates: Every time I try to add graphs to an host, Cacti creates a new data source for every graph!
How am I supposed to let Cacti create graphs referencing the single data source?
http://forums.cacti.net/viewtopic.php?f=12&t=40164
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest