|
|
| Author |
Message |
aimonb
Joined: 10 Jun 2008 Posts: 3
|
Posted: Tue Jun 10, 2008 3:04 am Post subject: remove_device.php & remove_graph.php CLI scripts |
|
|
Given the advent of cloud computing and the ultimate reality that servers will disappear forever having the ability to use the CLI to remove devices and graphs has become quite useful. So I have created remove_device.php & remove_graph.php CLI files which i would like to contribute. I used as much as possible the programming style of the add_device.php and add_graph.php files.
I will add the remove_graph.php file soon.
| Code: |
A very simple command line utility to remove a device or multiple devices from Cacti
Remove device usage: remove_device.php --device-id=[device ids]
Required:
--device-id comma separated list of host/device IDs.
List devices usage: remove_device.php --list-devices
List Options:
--list-devices Lists all devices
|
| Description: |
1.0.1 tag. This contains minor fix to help output.
uncompress and drop in the CLI folder in your cacti install |
|
 Download |
| Filename: |
remove_device.php.zip |
| Filesize: |
1.17 KB |
| Downloaded: |
88 Time(s) |
|
|
| Back to top |
|
 |
satish_kumarp2k1
Joined: 25 Mar 2008 Posts: 9 Location: Bangalore
|
Posted: Mon Sep 08, 2008 5:21 am Post subject: |
|
|
Hi,
Can you also upload the script to delete graphs?
Thanks
|
|
| Back to top |
|
 |
aimonb
Joined: 10 Jun 2008 Posts: 3
|
Posted: Thu Sep 11, 2008 1:31 am Post subject: |
|
|
| satish_kumarp2k1 wrote: | Hi,
Can you also upload the script to delete graphs?
Thanks |
I have yet to write it. The other script only took me a couple of hours. This should be about as easy. I am mid sprint for a release though. I will get it up after Oct 1st.
|
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9723 Location: MI, USA
|
Posted: Fri Sep 12, 2008 6:20 am Post subject: |
|
|
Make sure you provide an option to either Delete Graphs and Data Sources for both scripts. The default should be "yes", even though the default in Cacti for deleting Graphs is "no".
You should also allow specifying either a substring range, or regular expression, and provide the user the ability to confirm before delete. Like do the query, show the rows and then delete if the response comes back to proceed. Provide an option to "force".
There are lot's of example on how I have written argument handling in the add* scripts.
Thanks for contributing.
TheWitness
|
|
| Back to top |
|
 |
|