thold 0.3.9 not support batch apply thresholds?

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
looc
Cacti User
Posts: 110
Joined: Mon Aug 13, 2007 3:40 am

thold 0.3.9 not support batch apply thresholds?

Post by looc »

in older thold,it can be apply threholds in the devices page.
but i new install 0.3.9, in the devices,select one or more hosts,use action to apply thresholds,the next page list not any threhold apply?why?
Attachments
list to apply
list to apply
thold1.gif (11.95 KiB) Viewed 7773 times
thold2.gif
thold2.gif (2.55 KiB) Viewed 7773 times
Cacti Version - 0.8.7 & spine
Plugin Architecture - 1.3
Server Info - Windows 2003 EP
Web Server -IIS6.0
PHP - 5.2.3
MySQL - 4.1.10
RRDTool - 1.2.15
SNMP - 5.4.1
--------------------------
plugins:
reportit 0.5.1|monitor 0.8.1|thold 0.3.8
looc
Cacti User
Posts: 110
Joined: Mon Aug 13, 2007 3:40 am

Post by looc »

why onbody can be tell me that?you never occur this ?
Cacti Version - 0.8.7 & spine
Plugin Architecture - 1.3
Server Info - Windows 2003 EP
Web Server -IIS6.0
PHP - 5.2.3
MySQL - 4.1.10
RRDTool - 1.2.15
SNMP - 5.4.1
--------------------------
plugins:
reportit 0.5.1|monitor 0.8.1|thold 0.3.8
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

looc wrote:why onbody can be tell me that?you never occur this ?
I use 0.8.7a and thold 0.3.9 and I don't get this problem. I have added thresholds this way last week.

Do the devices selected *have* the data sources that you have templates for? (if you see what I mean

(I'd like to be able to have different threshold templates for different customers, but that's a different story)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
looc
Cacti User
Posts: 110
Joined: Mon Aug 13, 2007 3:40 am

Post by looc »

in the concretely device, i can be used Auto-create thresholds to apply tholds.but in the divices list i can't apply tholds yet :cry:
Attachments
thold3.gif
thold3.gif (9.87 KiB) Viewed 7680 times
Cacti Version - 0.8.7 & spine
Plugin Architecture - 1.3
Server Info - Windows 2003 EP
Web Server -IIS6.0
PHP - 5.2.3
MySQL - 4.1.10
RRDTool - 1.2.15
SNMP - 5.4.1
--------------------------
plugins:
reportit 0.5.1|monitor 0.8.1|thold 0.3.8
User avatar
TheGrudge
Posts: 37
Joined: Tue Feb 27, 2007 12:51 pm

Post by TheGrudge »

I'm also not able to create thresholds. I never used the cacti plugins before, so I'm very new to all this stuff.

All installed versions of my plugins can be found in the attachment.

I created a threshold template for UNIX-Load Average/5min, but I can not auto create any threshold, nothing happens. I'm also not able to create a threshold via datasources->add like it is mentioned in the treshold overview.
Maybe I'm doing something wrong, but I can't figure it out and unfortunately no documentation can be found here.
Is this plugin broken? Dead host notification is working fine, but I can't create thresholds for specific tasks... and I also get the "poller has not been run yet" phrase...
Attachments
my current cacti installation
my current cacti installation
cacti.png (26.77 KiB) Viewed 7594 times
User avatar
TheGrudge
Posts: 37
Joined: Tue Feb 27, 2007 12:51 pm

Post by TheGrudge »

Ok now it seems to work (I don't know why), but only if I click on a specific device in the devices list and choose "create new graph / auto-create threshold". If I just select one or more devices in the list overview and choose from the dropdown-menu "apply thresholds", no thresholds are created. Am I doing something wrong or is it just not working with cacti 0.8.7b...?
saya
Cacti User
Posts: 58
Joined: Wed Jan 16, 2008 10:56 pm

Post by saya »

ya mine is cacti 0.8.7a and thold0.3.9
when i just installed this plugin, it could choose to apply threshold to all device...but after a few days, this way don't work, just like ur case...can only create threshold seperately...I dont know what I did on it.. :cry:
ahouston
Posts: 6
Joined: Wed Jul 12, 2006 5:41 am

Post by ahouston »

OK - I think I've got this one figured out... looks like the Monitor plugin is incorrectly returning $action instead of $save in its

I've been putting some debugging output in the include/plugins.php and plugins/thold/setup.php files because it appeared that the whole thing was sticking in the thold_device_action_prepare() function.

Here is the debug from the first run:

Code: Select all

Debug do_function_hook() :
Array ( [drp_action] => thold [host_list] => 
ar1-lei

ar1-lgr
[host_array] => Array ( [0] => 27 [1] => 30 ) ) 
Hooks:
Array ( [monitor] => monitor_device_action_prepare [thold] => thold_device_action_prepare ) 

Debug thold_device_action_prepare():
thold  
OK , so it appears that the $save array is actually set to a scalar 'thold' by the time it gets to the thold_device_action_prepare() function, even though it left the do_function_hook() function with the correct values !?

The do_function_hook is calling the prepare function for another plugin - Monitor - prior to it calling Thold.

A quick look at the monitor plugin's monitor_device_action_prepare() shows the problem, its returning a local value $action instead of the $save array which is required by the following prepare function in the list, namely thold's one..

Code: Select all


function monitor_device_action_prepare($save) {
        global $colors, $host_list;
        $action = $save['drp_action'];
        if ($action != 'monitor_enable' || $action != 'monitor_disable')
                return $action;  <== Change this to: return $save 
Update: Looks like you need to correct the behaviour in the monitor_device_action_execute() function too ?!!

Code: Select all


function monitor_device_action_execute ($action) {
        global $config;

        if ($action != 'monitor_enable' && $action != 'monitor_disable')
                return; <=== Change this to:  return $action;

So to fix, I guess either correct the return statement(s) in plugins/monitor/setup.php as above or just comment out the monitor plugin out in include/global.php

Hope that helps :)
User avatar
TheGrudge
Posts: 37
Joined: Tue Feb 27, 2007 12:51 pm

Post by TheGrudge »

Disabling the monitor plugin did the trick. I just created all my thresholds and enabled monitor again... :)
User avatar
TheGrudge
Posts: 37
Joined: Tue Feb 27, 2007 12:51 pm

Post by TheGrudge »

The Discover-Plugin is also working again, with monitor enabled I couldn't add new devices to Cacti.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests