cacti plugin

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

cacti plugin

Post by ibrahim »

hello,

i have a list of routers that i have to monitor using cacti. is there any script or any way to monitor and enter those list automatically. coz i if enter them one by one it will take alot of time.

and i want to assign specific graphs for all of them. ( graph template)

any ideas or script done or plugin.

thx
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Take a look at the scripts in the 'cli' directory. You can create a simple script to loop those scripts to automate your additions.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

thx

Post by ibrahim »

thank you for ur reply.

am sorry am new to cacti. do u mind to tell me step by steo how to do this. or give me breif idea how to start + this 'cli' dir where can i find it.

thx again
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

If you are using the latest Cacti (0.8.7b), there should be a 'cli' directory. Within that directory are several scripts for adding devices, graphs and devices to trees.

Running those scripts without options will give you directions on how they function. Once you learn how they function, you can create a script to loop through them, adding multiple devices/graphs from a single script.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

Post by ibrahim »

thx i reinstalled the new version and i founf the cli dir . i ll try what you told me to do


thx
ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

Post by ibrahim »

do u have any ready script that can do that.


thx
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Each script is going to be different, based on what type of device you are adding, and how you set your Description/Hostname.

A very simple example for Cisco Router (template 5), setting the hostname and description to the same value, setting the availability to 'snmp', using SNMP version 2 would be:

Code: Select all

#!/bin/bash
list="host1 host2 host3"

for host in $list
  do
     /path/to/cacti/cli/add_device.php --description=$host --ip=$host --template=5 --avail=snmp --community={communitystring} --version=2
  done
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

Post by ibrahim »

thx alot

i appreciate , i am working on it
ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

Post by ibrahim »

it s working thank you, i am gona try to do it for add_graph.

do u have graph templates for cisco devices: temperature, octet, interfaces, cpu usage.......

am sorry, more over can you give me an example for the add_graph as the add_device one

am new to cacti am sorry


thx again u were really helpfull
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

The example above should be sufficient.

At some point, you are going to have to learn by trying it yourself....
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

Post by ibrahim »

thank you , u r right
ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

Post by ibrahim »

i have one more question. everything is working

i wanted to ask you:

graphically, i imorted a template for cisco. is there a way that to create all the graph that comes with this template without to go through each one of them


thx
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Loop the add_graphs.php scripts to add them to all of the devices.

To have the new graphs show up as options on the Devices page, associate the new graphs to the Cisco Router template via Console/Templates/Host Templates/Cisco Router/Associated Graph Templates.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
ibrahim
Posts: 27
Joined: Tue May 27, 2008 1:28 pm

Post by ibrahim »

i got it, do u have a very good template for cisco device in order that i download

and thx for ur help today
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

--
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 4 guests