|
|
| Author |
Message |
bligneri
Joined: 31 Jan 2007 Posts: 1
|
Posted: Wed Jan 31, 2007 8:57 pm Post subject: Cacti CLI ? |
|
|
Hello,
We are working for a customer that would like to create a Command Line Interface (CLI) that can be used to fill the CACTI configuration database instead of using the web Interface.
The main reason is that we have to deal with large Cacti deployement and we would like to automate the management of CACTI Devices as much as possible (I.e. :data is coming from an inventory database and contain all the releventant information so why using the Web Interface to create the devices ?. Ultimately ; we would like to automatically sync CACTI with the inventory database).
We would like to know if the CACTI community & developers would be interested by such a project.
At first, we would like to do a simple prototype that can :
- add a device
- position a device in the tree
- create tree node
- delete tree node
- delete a device
- move a device inside the tree
What would be the best langage to do it ?
[[ PHP would allow us to easily use existing CACTI code and would be my first choice }}
Flame / Comments / ideas / suggestion welcome. |
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9723 Location: MI, USA
|
Posted: Wed Jan 31, 2007 10:57 pm Post subject: |
|
|
There is one already. It's not officially supported by the developers. Search the addon's or use google.
TheWitness |
|
| Back to top |
|
 |
bard tablett
Joined: 12 Jun 2007 Posts: 2
|
Posted: Tue Jun 12, 2007 3:29 pm Post subject: Cacti CLI ? |
|
|
| I have a very similar need for a CLI for Cacti. I have googled this and looked around the forums and most of what I see are old posts, broken links, and disjointed threads. Could someone point me to a good resource? |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
|
| Back to top |
|
 |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5453 Location: Wisconsin, USA
|
Posted: Tue Jun 12, 2007 3:48 pm Post subject: |
|
|
| Quote: | Cacti CHANGELOG
0.8.6k
<snip>
-bug: Cacti does not have any way to mass add devices, graphs, tree's and permissions. |
CLI interfaces are coming in July!
If you pull the scripts from SVN branch_0_8_6, they should work with the latest release of Cacti, but I make not promises. Also, the still need some tweaking their paths will change before the release of 0.8.6k. |
|
| Back to top |
|
 |
bard tablett
Joined: 12 Jun 2007 Posts: 2
|
Posted: Tue Jun 12, 2007 4:05 pm Post subject: Cacti CLI ? |
|
|
Do you have a link to SVN branch_0_8_6? Also, the data we are graphing is all derived from Perl scripts. No SNMP. Will this CLI work with non-SNMP data?
Also, early July or late July?
TIA |
|
| Back to top |
|
 |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5453 Location: Wisconsin, USA
|
Posted: Tue Jun 12, 2007 4:20 pm Post subject: |
|
|
July.... I will not set a date.
I don't know if it supports that, but my gut tells me yes, based off of templates. |
|
| Back to top |
|
 |
apperrault Cacti User
Joined: 16 Feb 2007 Posts: 354 Location: Emeryville, CA
|
Posted: Tue Jun 12, 2007 5:22 pm Post subject: |
|
|
Rony, so does this mean i should hold off on rebuilding my Cacti server until you guys release the newest version...
Just how stable is the SVN version?
Just wondering. Although, maybe I should rebuild it anyway on the current version and get cactid working properly...
Off to the server room.
app |
|
| Back to top |
|
 |
mcutting Cacti Pro User
Joined: 16 Oct 2006 Posts: 989
|
Posted: Wed Jun 13, 2007 12:36 am Post subject: |
|
|
| App - I take it that the CACTID I sent you did not work ? |
|
| Back to top |
|
 |
rcaston Cacti User
Joined: 06 Jan 2004 Posts: 199 Location: US-Dallas, TX
|
Posted: Wed Jun 20, 2007 2:54 pm Post subject: |
|
|
| rony wrote: | | Quote: | Cacti CHANGELOG
0.8.6k
<snip>
-bug: Cacti does not have any way to mass add devices, graphs, tree's and permissions. |
CLI interfaces are coming in July!
|
This is the best news I've heard all month
I have about 60,000 interfaces I need to smite... |
|
| Back to top |
|
 |
rcaston Cacti User
Joined: 06 Jan 2004 Posts: 199 Location: US-Dallas, TX
|
Posted: Tue Jun 26, 2007 11:27 am Post subject: |
|
|
| Where are the current CLI scripts in the SVN Dev/Unstable Trunk tree? I'd like to experiment with them. |
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9723 Location: MI, USA
|
Posted: Tue Jun 26, 2007 1:54 pm Post subject: |
|
|
They are in BRANCH_0_8_6. There are 5 files of interest. They are:
add_device.php
add_graphs.php
add_perms.php
add_tree.php
lib/api_automation_tools.php
The only files "done" if you will are the add_device.php and add_graphs.php. I have changed the syntax to allow you to be more flexible when adding devices and graphs.
The other two files, I have yet to examine in detail.
If you were a prior user of these scripts, please note the syntax has changed significantly.
Regards,
TheWitness
Add Device Syntax
| Code: | Usage:
add_device.php --description=[description] --ip=[IP] --template=[ID] [--disable]
[--version=[1|2|3]] [--community=] [--username= --password=] [--port=161] [--timeout=500]
Required:
- description: the name that will be displayed by Cacti in the graphs
- ip: self explanatory (can also be a FQDN)
- template is a number (read below to get a list of templates)
Optional:
- disable: 0, 1 to add this host but to disable checks and 0 to enable it
- version: 1, 1|2|3, snmp version
- community: '', snmp community string for snmpv1 and snmpv2. Leave blank for no community
- username: '', snmp username for snmpv3
- password: '', snmp password for snmpv3
- port: 161
- timeout: 500
List Options: --list-templates
--list-communities |
Add Graphs Syntax
| Code: | Usage:
add_graphs.php --graph-type=[cg|ds] --graph-template-id=[ID]
--host-id=[ID] [--graph-title=title] [graph options] [--force]
For cg graphs: [--force]
--force is optional - if you set this flag, then new cg graphs will be created, even though they may already exist.
For ds graphs: --snmp-query-id=[ID] --snmp-query-type-id=[ID] --snmp-field=[SNMP Field] --snmp-value=[SNMP Value]
--graph-title is optional - it defaults to what ever is in the graph template/data-source template.
List Options: --list-hosts
--list-graph-templates
--list-snmp-queries
--snmp-query-id [ID] --list-query-types
--host-id=[ID] --list-snmp-fields
--host-id=[ID] --snmp-field=[Field] --list-snmp-values
'cg' graphs are for things like CPU temp/fan speed, while 'ds' graphs are for data-source based graphs (interface stats etc.) |
|
|
| Back to top |
|
 |
rcaston Cacti User
Joined: 06 Jan 2004 Posts: 199 Location: US-Dallas, TX
|
Posted: Wed Jun 27, 2007 1:06 pm Post subject: |
|
|
im trying to get the add_graphs script to work with the current stable release of cacti; but i think the api_automation_tools.php needs to be added into the stable build as well, but upon doing that I run into other errors.
So... whens the ETA on the next release of cacti > |
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9723 Location: MI, USA
|
Posted: Wed Jun 27, 2007 1:16 pm Post subject: |
|
|
Next month. You can add the api function without issue.
Larry |
|
| Back to top |
|
 |
Taiphun
Joined: 08 Jan 2007 Posts: 21
|
Posted: Wed Jun 27, 2007 1:37 pm Post subject: |
|
|
Cool. I am eagerly looking forward to this.
Thanks to all the developers for all the hard work! |
|
| Back to top |
|
 |
|