You definitely have to remove the old one first, or there could be issues with duplicate functions. Also, remove the old cron job as its not needed anymore.Diggit2001 wrote:Hmmm. This looks interesting. I wish I would have found this earlier.
Can I install this architecture overtop of my existing (old) thold or should I attempt to remove thold first?
Thanks!
Thold 2.x - Thresholding/Alerting module for cacti 8.6
Moderators: Developers, Moderators
-
- Cacti User
- Posts: 367
- Joined: Tue Apr 05, 2005 9:52 am
- Location: Munich, Germany
Hello,
last week a switch rebooted and we did not recognize it.
So I changed the thold functions (here is allready an email-function included) so that cacti checks the uptime, stores it in the host-db and sets a flag if the device has rebooted. This flag is cleared in the next poller run.
Alter the host-table:
in plugin/thold/check-thold.php insert this lines after line 92 and
before "foreach ($queryrows as $q_row) ":
in cmd.php insert this lines:
Line 106 add:
At line 259 near $new_host = false;
insert this right after it:
$last_host2 = $last_host;
Some line further insert quite after the "else" of this block
insert this block:
Finally I changed host.php:
at line 784 I inserted host.uptime so that this look like
and at line 828 I inserted at the end of the <td>s:
Now cacti stores for each host the uptime and set the flag. Thold checks for this flag and send an email to the admins (only if dead host notification is enabled).
Hope this would not interfear with other scripts /php commands. I hope this mod could make it into the official releases.
Torsten
last week a switch rebooted and we did not recognize it.
So I changed the thold functions (here is allready an email-function included) so that cacti checks the uptime, stores it in the host-db and sets a flag if the device has rebooted. This flag is cleared in the next poller run.
Alter the host-table:
Code: Select all
mysql
ALTER TABLE `host` ADD `uptime` VARCHAR(20) NULL DEFAULT '0' , ADD `reboot` VARCHAR( 3 ) NULL DEFAULT '0';
before "foreach ($queryrows as $q_row) ":
Code: Select all
#-------reboot-monitor
$sql = "SELECT description, hostname, id, uptime FROM host where reboot ='1' AND uptime > 1";
## $result = db_fetch_assoc($sql) or die (mysql_error());
## changed to:
$result = db_fetch_assoc($sql);
foreach ($result as $item)
{
$msg= " Device ". $item["description"]." has rebooted an came up at ".date("h:i:s d-m-Y");
$subject = "Reboot of ".$item["hostname"] ;
$file_array =array();
if ($deadnotify)
{ thold_mail($global_alert_address, '', $subject, $msg, $file_array);
print("Reboot detected on " . $item["hostname"]."\n");
}
}
#-------reboot-monitor
in cmd.php insert this lines:
Line 106 add:
Code: Select all
$snmp_uptime = 0;
At line 259 near $new_host = false;
insert this right after it:
$last_host2 = $last_host;
Some line further insert quite after the "else" of this block
Code: Select all
if (($item["snmp_version"] == 0) || (($item["snmp_community"] == "") && ($item["snmp_version"] != 3))) {
cacti_log("Host[$host_id] DS[$data_source] ERROR: Invalid SNMP Data Source. Please either delete it from the database, or correct it.", $print_data_to_stdout);
$output = "U";
}else {
Code: Select all
if ($last_host2 != $current_host)
{
$last_host2 = $current_host;
$snmp_uptime = cacti_snmp_get($item["hostname"], $item["snmp_community"], ".1.3.6.1.2.1.1.3.0", $item["snmp_version"], $item["snmp_username"], $item["snmp_password"], $item["snmp_port"], $item["snmp_timeout"], SNMP_WEBUI);
if ($snmp_uptime > 10 )
{
$old_uptime= db_fetch_cell("SELECT uptime FROM host WHERE id='" . $item["host_id"] . "'");
cacti_log("Uptime of " . $item["hostname"] . ",ID:" . $item["host_id"] . " - old=$old_uptime cur
:$snmp_uptime",$print_data_to_stdout);
if ( $old_uptime > $snmp_uptime )
{ db_execute("update host set reboot='1' where id='" . $item["host_id"] . "'");
cacti_log("REBOOT detected of device " . $item["hostname"] . ": Old:".$old_uptime." Current
:".$snmp_uptime ,$print_data_to_stdout);
}
else
{ db_execute("update host set reboot='0' where id='" . $item["host_id"] . "'"); }
db_execute("update host set uptime=$snmp_uptime where id='" . $item["host_id"] . "'");
}
else
{cacti_log("Could not fetch Uptime of " . $item["hostname"] . ",ID:" . $item["host_id"],$print_da
ta_to_stdout); }
}
at line 784 I inserted host.uptime so that this look like
Code: Select all
host.avg_time,
host.availability ,
host.uptime
from host
$sql_where
order by host.description
Code: Select all
<td><?php print (round($host["uptime"]/8640000, 1));?>d</td>
Hope this would not interfear with other scripts /php commands. I hope this mod could make it into the official releases.
Torsten
Last edited by torstentfk on Wed Mar 08, 2006 6:55 am, edited 2 times in total.
-
- Cacti User
- Posts: 367
- Joined: Tue Apr 05, 2005 9:52 am
- Location: Munich, Germany
segmentation fault
after i installed thold plugin on my cacti-0.8.6h-1.2.el4.rf the webpage stopped working and running poller gave segmentation fault. what could be the problem??
Re: segmentation fault
i had the same problem, but haven't found a complete solution yet. The problem is releted to the functions.php file. Just backup it and replace it with the original file (it was saved by install.sh as functions.php.bak)jay_kumar wrote:after i installed thold plugin on my cacti-0.8.6h-1.2.el4.rf the webpage stopped working and running poller gave segmentation fault. what could be the problem??
You will get access to the tool again, but u will receive some error mesagges.
I've been using cacti for about a year, but haven't really had the time to look into expanding it.
Tried out Thold 0.2.1a on two existing cacti installations (0.86g and 0.86c) and it managed to break importing templates for both of them,
When I upgraded to 0.86h (as I thought well maybe templates need to be from the same version of cacti), it finally broke the cacti frontend (poller seemed to be okay). I managed to uninstall it using the script and removing the thold tables for the mysql database.
I've now installed the plugin architecture 0.9 and thold 0.2.7 from cactiusers.org and all is now well, and I've only lost about an hour of monitoring data!
Moderators - I know I'm new around here and don't want to cause trouble; but do you think that it would be good forum moderation for this thread to be locked. With a new one created with details of thold 0.2.7 and the plugin architecture method of install? (and a reference to this thread) As I know I for one wasn't prepared to read 34 pages of posts before installing.
Tried out Thold 0.2.1a on two existing cacti installations (0.86g and 0.86c) and it managed to break importing templates for both of them,
When I upgraded to 0.86h (as I thought well maybe templates need to be from the same version of cacti), it finally broke the cacti frontend (poller seemed to be okay). I managed to uninstall it using the script and removing the thold tables for the mysql database.
I've now installed the plugin architecture 0.9 and thold 0.2.7 from cactiusers.org and all is now well, and I've only lost about an hour of monitoring data!
Moderators - I know I'm new around here and don't want to cause trouble; but do you think that it would be good forum moderation for this thread to be locked. With a new one created with details of thold 0.2.7 and the plugin architecture method of install? (and a reference to this thread) As I know I for one wasn't prepared to read 34 pages of posts before installing.
I have been thinking of doing that for a bit, it would save me alot of time also. I will see about starting writing it.aggie wrote:I've been using cacti for about a year, but haven't really had the time to look into expanding it.
Tried out Thold 0.2.1a on two existing cacti installations (0.86g and 0.86c) and it managed to break importing templates for both of them,
When I upgraded to 0.86h (as I thought well maybe templates need to be from the same version of cacti), it finally broke the cacti frontend (poller seemed to be okay). I managed to uninstall it using the script and removing the thold tables for the mysql database.
I've now installed the plugin architecture 0.9 and thold 0.2.7 from cactiusers.org and all is now well, and I've only lost about an hour of monitoring data!
Moderators - I know I'm new around here and don't want to cause trouble; but do you think that it would be good forum moderation for this thread to be locked. With a new one created with details of thold 0.2.7 and the plugin architecture method of install? (and a reference to this thread) As I know I for one wasn't prepared to read 34 pages of posts before installing.
-
- Cacti User
- Posts: 70
- Joined: Tue Feb 21, 2006 9:50 am
Threshold not sending email
i can send test mail sucessfully from threshold but when a host goes down or breaches threshold it says Trigger as YES but no mail is seen.pls help
-
- Cacti User
- Posts: 367
- Joined: Tue Apr 05, 2005 9:52 am
- Location: Munich, Germany
Plugin achitecture, thold, monitor and other plugins from http://cactiusers.org/
work out of the box with latest version of Cacti.
I don't know who Jimmy is but he does a great job.
work out of the box with latest version of Cacti.
I don't know who Jimmy is but he does a great job.
Re: Threshold not sending email
Usually a problem with your mail settings. Check them and make sure you are able to receive the test emails properly.anuraganuj wrote:i can send test mail sucessfully from threshold but when a host goes down or breaches threshold it says Trigger as YES but no mail is seen.pls help
-
- Cacti User
- Posts: 70
- Joined: Tue Feb 21, 2006 9:50 am
Tested again
Hi cigamit,
I tested sending d test mails again and again but trigger mail is missing
I tested sending d test mails again and again but trigger mail is missing
Problem creating threshold template
I'm creating a threshold template for my Interface - Traffic in and out. I want to do baseline deviation up only. The instructions for ignoring baseline deviation down say "if not set, lower bound threshold will not be checked at all". I left that box empty and saved, but when I came back to it, it was filled with "0". I cannot remove it.
When I apply the threshold to one of my interfaces, it reports the baseline deviation down.
I can go to Management / Thresholds, edit the individual threshold, and delete the baseline deviation down in that screen.
It seems to be a bug. It's not possible to leave the baseline deviation box empty in the Threshold Template page.
When I apply the threshold to one of my interfaces, it reports the baseline deviation down.
I can go to Management / Thresholds, edit the individual threshold, and delete the baseline deviation down in that screen.
It seems to be a bug. It's not possible to leave the baseline deviation box empty in the Threshold Template page.
problem with current value
hi have a problem with thold
when i use "Auto-create thresholds" its add all graph on thold
but the "current" values are all time at "0"
when i start manually the "check-thold.php"
i have never value in "Cur. value:" :
------------------
RRA: 420 : proc
Ref. values count: 37
Ref. value (min): 36
Ref. value (max): 42
Cur. value:
Low bl thresh: 31
High bl thresh: 48
Check against baseline: FAIL: Below baseline threshold!
------------------
RRA: 360 : cpu_nice
Ref. values count: 26
Ref. value (min): 0
Ref. value (max): 0
Cur. value:
Low bl thresh: 0
High bl thresh: 0
Check against baseline: OK
------------------
RRA: 364 : load_15min
Ref. values count: 26
Ref. value (min): 1
Ref. value (max): 2
Cur. value:
Low bl thresh: 1
High bl thresh: 2
Check against baseline: FAIL: Below baseline threshold!
------------------
in the thold.log have no value too :
03-17-06.20:50:02 element: mail6 - Traffic - shaper0[traffic_in] alertstat: 0 graph_id: 329 thold_low: thold_hi: rra: 371 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:02 element: mail6 - Partition - /dev/sda1[hdd_free] alertstat: 0 graph_id: 330 thold_low: thold_hi: rra: 372 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:02 element: mail6 - Partition - /dev/sda1[hdd_used] alertstat: 0 graph_id: 330 thold_low: thold_hi: rra: 372 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:02 element: mail6 - Partition - /dev/sdb1[hdd_used] alertstat: 0 graph_id: 331 thold_low: thold_hi: rra: 373 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:04 element: mail6 - Partition - /dev/sdb1[hdd_free] alertstat: 0 graph_id: 331 thold_low: thold_hi: rra: 373 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - Partition - /dev/sdb2[hdd_free] alertstat: 0 graph_id: 332 thold_low: thold_hi: rra: 374 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - Partition - /dev/sdb2[hdd_used] alertstat: 0 graph_id: 332 thold_low: thold_hi: rra: 374 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - Partition - /dev/sda3[hdd_free] alertstat: 0 graph_id: 333 thold_low: thold_hi: rra: 375 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - Partition - /dev/sda3[hdd_used] alertstat: 0 graph_id: 333 thold_low: thold_hi: rra: 375 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - CPU Usage - System[cpu_system] alertstat: 0 graph_id: 324 thold_low: thold_hi: rra: 361 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: hdi - Processes[proc] alertstat: 0 graph_id: 365 thold_low: thold_hi: 30 rra: 420 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: mail6 - CPU Usage - Nice[cpu_nice] alertstat: 0 graph_id: 324 thold_low: thold_hi: rra: 360 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: mail6 - Load Average - 15 Minute[load_15min] alertstat: 0 graph_id: 325 thold_low: thold_hi: rra: 364 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: mail6 - Load Average - 1 Minute[load_1min] alertstat: 0 graph_id: 325 thold_low: thold_hi: rra: 363 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: mail6 - CPU Usage - User[cpu_user] alertstat: 0 graph_id: 324 thold_low: thold_hi: rra: 362 trigger: 1 triggerct: 0 current: logset:
someone have an idea for resolve that ?
thanks
when i use "Auto-create thresholds" its add all graph on thold
but the "current" values are all time at "0"
when i start manually the "check-thold.php"
i have never value in "Cur. value:" :
------------------
RRA: 420 : proc
Ref. values count: 37
Ref. value (min): 36
Ref. value (max): 42
Cur. value:
Low bl thresh: 31
High bl thresh: 48
Check against baseline: FAIL: Below baseline threshold!
------------------
RRA: 360 : cpu_nice
Ref. values count: 26
Ref. value (min): 0
Ref. value (max): 0
Cur. value:
Low bl thresh: 0
High bl thresh: 0
Check against baseline: OK
------------------
RRA: 364 : load_15min
Ref. values count: 26
Ref. value (min): 1
Ref. value (max): 2
Cur. value:
Low bl thresh: 1
High bl thresh: 2
Check against baseline: FAIL: Below baseline threshold!
------------------
in the thold.log have no value too :
03-17-06.20:50:02 element: mail6 - Traffic - shaper0[traffic_in] alertstat: 0 graph_id: 329 thold_low: thold_hi: rra: 371 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:02 element: mail6 - Partition - /dev/sda1[hdd_free] alertstat: 0 graph_id: 330 thold_low: thold_hi: rra: 372 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:02 element: mail6 - Partition - /dev/sda1[hdd_used] alertstat: 0 graph_id: 330 thold_low: thold_hi: rra: 372 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:02 element: mail6 - Partition - /dev/sdb1[hdd_used] alertstat: 0 graph_id: 331 thold_low: thold_hi: rra: 373 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:04 element: mail6 - Partition - /dev/sdb1[hdd_free] alertstat: 0 graph_id: 331 thold_low: thold_hi: rra: 373 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - Partition - /dev/sdb2[hdd_free] alertstat: 0 graph_id: 332 thold_low: thold_hi: rra: 374 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - Partition - /dev/sdb2[hdd_used] alertstat: 0 graph_id: 332 thold_low: thold_hi: rra: 374 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - Partition - /dev/sda3[hdd_free] alertstat: 0 graph_id: 333 thold_low: thold_hi: rra: 375 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - Partition - /dev/sda3[hdd_used] alertstat: 0 graph_id: 333 thold_low: thold_hi: rra: 375 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:07 element: mail6 - CPU Usage - System[cpu_system] alertstat: 0 graph_id: 324 thold_low: thold_hi: rra: 361 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: hdi - Processes[proc] alertstat: 0 graph_id: 365 thold_low: thold_hi: 30 rra: 420 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: mail6 - CPU Usage - Nice[cpu_nice] alertstat: 0 graph_id: 324 thold_low: thold_hi: rra: 360 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: mail6 - Load Average - 15 Minute[load_15min] alertstat: 0 graph_id: 325 thold_low: thold_hi: rra: 364 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: mail6 - Load Average - 1 Minute[load_1min] alertstat: 0 graph_id: 325 thold_low: thold_hi: rra: 363 trigger: 1 triggerct: 0 current: logset:
03-17-06.20:50:08 element: mail6 - CPU Usage - User[cpu_user] alertstat: 0 graph_id: 324 thold_low: thold_hi: rra: 362 trigger: 1 triggerct: 0 current: logset:
someone have an idea for resolve that ?
thanks
Who is online
Users browsing this forum: No registered users and 0 guests