create thold automatically for new graphs

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
lucajet
Posts: 21
Joined: Wed Oct 27, 2010 1:37 pm

create thold automatically for new graphs

Post by lucajet »

I have created a threshold template for disk occupation based on Stdrd HOST-RESOURCE-MIB hrStorage data template.
Then i selected all the related graphs for all my devices and i created thresholds from template.
I can then customize particular tholds eventually.
So far, so good.

I don't get how i can have the threshold template automatically used when i add a new disk graph for a new device.

On settings --> Threshold i saw an option
Auto Create Thresholds
If selected, when running either automation, or when creating/saving a Device, all Thresholds associated with the Device Template will be created.
but the threshold template is tied to a data template, not to a device!
So i did anyway changed my device template "Standard SNMP Enabled Host Basic OS" which i normally use to add
Stdrd HOST-RESOURCE-MIB hrStorage [hrStorageUsed]

But i don't understand, when i add a new host (template 6 is my id for the device template above)

Code: Select all

php -q add_device.php --description="fooserver" --ip="192.168.100.27" --template=6 --community="my_private_one"
i don't have (yet) my disks created, i still have to run the part of my script that detects partitions and add them

Code: Select all

for folder in `php -q add_graphs.php --host-id=$hostid --snmp-field=hrStorageDescr --list-snmp-values | grep  / | grep -v shm | grep -v "/run" | grep -v "/sys/fs/cgroup" `;do
        /bin/php -q add_graphs.php --host-id=$hostid --graph-type=ds --graph-template-id=`graph_template_id "Stdrd HOST-RESOURCE-MIB - Storage size/used"` --snmp-query-id=`snmp_query_id "Stdrd_HOST-RESOURCE-MIB hrStorage"` --snmp-query-type-id=`snmp_query_type_id "Stdrd_HOST-RESOURCE-MIB hrStorage" "Stdrd HOST-RESOURCE-MIB - Storage size/uesd"` --snmp-field=hrStorageDescr --snmp-value=$folder
done
So, how can i have the new thresholds to be created ?
dnixneodevine
Posts: 13
Joined: Wed Sep 13, 2017 3:58 am

Re: create thold automatically for new graphs

Post by dnixneodevine »

Hi!

I have similar problem, i need to create threshold when my cacti automatically created new graph...

Did you find the way to do this?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest