Automated Tholds Creation by Graph and Data Sources lists

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Automated Tholds Creation by Graph and Data Sources lists

Post by shd »

Updated cli_thresholds.php script from Thold v0.5 to create thresholds by graph list or data sources list. If Thold template id is not given, script finds all suitable templates.

Examples:

Code: Select all

$ /usr/bin/php cli_thresholds_my.php --data-ids='74 93 76'
Graph #70:
     Created threshold for the Graph 'Interface - Traffic' using the Data Source 'traffic_in'
Graph #89:
     Created threshold for the Graph 'Interface - Traffic' using the Data Source 'traffic_in'
Graph #72:
     Created threshold for the Graph 'Interface - Traffic' using the Data Source 'traffic_in'

$ /usr/bin/php cli_thresholds_my.php --graph-ids='4930'
Graph #4930:
     Created threshold for the Graph 'Interface - Traffic' using the Data Source 'traffic_in'
I use it with Weathermap to automate tholds creation of an interesting links only:

Code: Select all

$ grep TARGET.*\.rrd$ ../weathermap/configs/*.conf | sed 's/.*\/\([0-9]\+\)\.rrd/\1/' | tr '\n' ' ' | sed 's/ $//g' | xargs -I{} echo "/usr/bin/php cli_thresholds_my.php --data-ids='{}'"
/usr/bin/php cli_thresholds_my.php --data-ids='74 93 76 ...'
Attachments
cli_thresholds_my.php.txt
updated cli_thresholds.php
(11.8 KiB) Downloaded 133 times
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest