CLI commands to delete graphs and data sources.

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
richardmc
Posts: 13
Joined: Wed Oct 29, 2008 11:49 pm
Location: Melbourne, Australia

CLI commands to delete graphs and data sources.

Post by richardmc »

Hello, just wondering if there is a way that we can delete data sources and graphs via cli in the same way that they can be created? We run an ISP that requires operational staff to monitor up to 100 data sources (customer subinterface traffic) for a period of time and then delete the graphs/data sources to avoid filling up the 1 minute poller we've deployed. It would be great if we could programmically remove graphs/data sources after a week via a cron process etc.

Alternatively could this be achieved with some plugin development?

Regards, Richard M

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

Post by Linegod »

remove_graph and remove_device are in SVN (I wouldn't use them for production - that's not true, I would use them for production, I wouldn't _recommend_ them for production)

They should either work, or only require minor tweaking to work with 087
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
richardmc
Posts: 13
Joined: Wed Oct 29, 2008 11:49 pm
Location: Melbourne, Australia

SVN suggestion

Post by richardmc »

Thanks for that. I'll certainly try the development version and will provide some feedback if necessary.
richardmc
Posts: 13
Joined: Wed Oct 29, 2008 11:49 pm
Location: Melbourne, Australia

remove_graph.php errors

Post by richardmc »

Tried the SVN version of remove_graph.php and had a couple of errors as shown below. The graphs and data sources seem to be deleted ok however?

[root@210 cli]# php remove_graph.php --graph-id=12 --force

PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/include/global_settings.php:1196) in /var/www/cacti/include/global.php on line 157
PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/include/global_settings.php:1196) in /var/www/cacti/include/global.php on line 158
PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/include/global_settings.php:1196) in /var/www/cacti/include/global.php on line 159
PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/include/global_settings.php:1196) in /var/www/cacti/include/global.php on line 160
PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/include/global_settings.php:1196) in /var/www/cacti/include/global.php on line 161
PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/include/global_settings.php:1196) in /var/www/cacti/include/global.php on line 163
PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/cacti/include/global_settings.php:1196) in /var/www/cacti/include/global.php on line 167
PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/cacti/include/global_settings.php:1196) in /var/www/cacti/include/global.php on line 167

Removing graph and all resources for graph id 12. Success - removed graph-id: (12)
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

You can ignore that error for now, it will just cause the script to be a little slow.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
sluke
Posts: 22
Joined: Mon Apr 21, 2008 2:49 pm

Post by sluke »

Did anyone get the SVN version of remove_graph.php to work with 0.8.7b?

Can you post the steps to get/install ???

TIA!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

sluke wrote:Did anyone get the SVN version of remove_graph.php to work with 0.8.7b?

Can you post the steps to get/install ???

TIA!
There will be no support for it in 087. It's scheduled for 088. But nobody will stop you from changing it to your needs.
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests