Cacti CLI ?
Moderators: Developers, Moderators
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.
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.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
There is one already. It's not officially supported by the developers. Search the addon's or use google.
TheWitness
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?
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?
-
- Posts: 2
- Joined: Tue Jun 12, 2007 3:25 pm
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?
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
CLI interfaces are coming in July!Cacti CHANGELOG
0.8.6k
<snip>
-bug: Cacti does not have any way to mass add devices, graphs, tree's and permissions.
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.
[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]
[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]
-
- Posts: 2
- Joined: Tue Jun 12, 2007 3:25 pm
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
Also, early July or late July?
TIA
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
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.
I don't know if it supports that, but my gut tells me yes, based off of templates.
[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]
[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]
-
- Cacti User
- Posts: 379
- Joined: Fri Feb 16, 2007 11:37 am
- Location: Emeryville, CA
- Contact:
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
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
[b]Cacti Version[/b] - 0.8.7b
[b]Plugin Architecture[/b] - 2.2 Beta
[b]Poller Type[/b] - CMD.php
[b]Server Info[/b] - Linux 2.6.9-78.0.1.ELsmp
[b]Web Server[/b] - Apache/2.0.52 (Red Hat)
[b]PHP[/b] - 4.3.9
[b]MySQL[/b] - 4.1.22
[b]RRDTool[/b] - 1.2.23
[b]SNMP[/b] - 5.1.2
[b]Plugins[/b][list]Global Plugin Settings (settings - v0.5)
SuperLinks (superlinks - v0.72)
Host Info (hostinfo - v0.2)
Report Creator (reports - v0.3)
Update Checker (update - v0.4)
Realtime for Cacti (realtime - v0.35)
Cacti Log View (clog - v1.1)
RRD File Cleaner (rrdclean - v0.36)
Network Discovery (discovery - v0.9)
Uptime (uptime - v0.4)[/list]
[b]Plugin Architecture[/b] - 2.2 Beta
[b]Poller Type[/b] - CMD.php
[b]Server Info[/b] - Linux 2.6.9-78.0.1.ELsmp
[b]Web Server[/b] - Apache/2.0.52 (Red Hat)
[b]PHP[/b] - 4.3.9
[b]MySQL[/b] - 4.1.22
[b]RRDTool[/b] - 1.2.23
[b]SNMP[/b] - 5.1.2
[b]Plugins[/b][list]Global Plugin Settings (settings - v0.5)
SuperLinks (superlinks - v0.72)
Host Info (hostinfo - v0.2)
Report Creator (reports - v0.3)
Update Checker (update - v0.4)
Realtime for Cacti (realtime - v0.35)
Cacti Log View (clog - v1.1)
RRD File Cleaner (rrdclean - v0.36)
Network Discovery (discovery - v0.9)
Uptime (uptime - v0.4)[/list]
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
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
Add Graphs Syntax
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: Select all
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
Code: Select all
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.)
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?
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?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Next month. You can add the api function without issue.
Larry
Larry
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?
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?
Who is online
Users browsing this forum: No registered users and 0 guests