Thold 2.x - Thresholding/Alerting module for cacti 8.6

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Locked
markske
Posts: 6
Joined: Fri Mar 18, 2005 2:41 am

Triger Max 2147483647

Post by markske »

Very nice addon :)

I need to set a trigger for diskspace on 4000000000 but the config always change it to 2147483647

So how can I get this max trigger to an higher value
2: hdd_used
Hi: 2147483647 Lo: n/a BL: off
markske
Posts: 6
Joined: Fri Mar 18, 2005 2:41 am

Post by markske »

I have not enough knowledge but I changed the following in the mysql table
thay have default int(50)

I now it is not correct but it works for now in my env

thold_hi varchar(100) default NULL,
thold_low varchar(100) default NULL,
lastread varchar(100) default NULL,




ps, the login for guest is also not working for the threshld page
rasmus
Posts: 1
Joined: Sun Mar 20, 2005 3:16 pm

troubles with autocreate thresholds

Post by rasmus »

Hi

first of all, nice module, just what I needed - thanks.

I do have a problem with autocreating thresholds using thold2.1a, when using the link "auto generate thresholds" I get the folling error:

Update failed:

INSERT INTO thold (element, rra) VALUES (,
You have an error in your SQL syntax near ' ' at line 1

seems like it can't locate the element value (looked through the code and the value is that of $graph which means
$grapharr = mysql_fetch_array(mysql_query("SELECT local_graph_id FROM graph_templates_item WHERE task_item_id=$rrdlookup LIMIT 1"));
$graph = $grapharr["local_graph_id"];

)


Any ideas as to why this doesn't seam to work? If i manualy add "INSERT INTO thold (element, rra) VALUES (1, " throug a mysql manager (1 being a random number) and afterwards rerun the autocreate thresholds it work just fin.

thanks in advanced

/Rasmus
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

Hi
I install cacti 0.8.6c and install thold2.0c like descibe in README.
Then,
I manually run this command:
[root@cacti-test /]# php /www/htdocs/cacti/thold/check-thold.php
And I got this errors:
[root@cacti-test /]# /www/php/bin/php /www/htdocs/cacti/thold/check-thold.php

Warning: main(../include/config.php): failed to open stream: No such file or directory in /www/htdocs/cacti/thold/check-thold.php on line 25

Warning: main(): Failed opening '../include/config.php' for inclusion (include_path='.:/www/php/lib/php') in /www/htdocs/cacti/thold/check-thold.php on line 25

Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in /www/htdocs/cacti/thold/check-thold.php on line 33

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /www/htdocs/cacti/thold/check-thold.php on line 34

Warning: mysql_query(): Access denied for user 'root'@'localhost' (using password: NO) in /www/htdocs/cacti/thold/check-thold.php on line 35

Warning: mysql_query(): A link to the server could not be established in /www/htdocs/cacti/thold/check-thold.php on line 35

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /www/htdocs/cacti/thold/check-thold.php on line 35
Access denied for user 'root'@'localhost' (using password: NO)
Can anybody solve this??
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

This is great!!

Post by chadd »

We are using an old version of MRTG at the moment, and I had written a crued perl script to send threshold alerts to my boss and myself. I am building a new server and plan to run Cacti, so this is really cool.

Question is: Can you set, say, an 80% threshold on all graphs as a default, then set more specific thresholds for individual graphs, as needed? That would ROCK!

Thanks again.

-chadd.
FreRange
Posts: 23
Joined: Wed Mar 30, 2005 2:13 pm
Location: Irvine, CA

Re: Single vs. Double quotes with _REQUEST

Post by FreRange »

benhanson wrote:So it appears that if I change the double quotes in _REQUEST["hostid"] to single quotes, _REQUEST['hostid'] that it fails LESS. Still works consistently if the first to If statements are removed, though this kills some functionality. What's the deal with "" or '' ?

I'm having this issue with IIS6 on W2K3 PHP5.

It seems like IE6 locks up but if you stop the page load and then view the source of the page you will see where in the code this page is breaking...

<snip>
<form name="THold" action=thold.php method=post>
<input type='hidden' name='rra' value='13'>
<input type='hidden' name='hostid' value='<br />
<b>Notice</b>: Undefined variable: hostid in <b>C:\NMS\cacti\thold.php</b> on line <b>82</b><br />
'>
Data Source Description: <br><strong>A-MGR - Process - System</strong><br><br>
<!-- Threshold: <br><input type='text' name='thold' size='10' maxlength='20' value="<br />
<b>Notice</b>: Undefined index: threshold in <b>C:\NMS\cacti\thold.php</b> on line <b>84</b><br />
" ><br>
-->

Somehow the page is losing the HOSTID var.

Just adding my .02

David Gibbons
FreRange
Posts: 23
Joined: Wed Mar 30, 2005 2:13 pm
Location: Irvine, CA

Re: Single vs. Double quotes with _REQUEST

Post by FreRange »

Well after a little expermenting on my side I think that there is something wrong with how thold.php calls graphs.

It all starts around line 106 (I made other changes so I'm not sure of the orginal line number)
<snip>
<img src="graph_image.php?local_graph_id=<?php echo $graph ?>&rra_id=1&graph_start=-32400&graph_height=100&graph_width=300&graph_nolegend=true">
</snip>

It looks like you can get 1 call to graph in this code then IIS6 will no longer produce grahps. You have to restart the IIS service to create any grahps anywhere in the site.

Maybe this should be re-coded to follow the graph_image.php, graph.php and the like. I'm bumping around in the code a little more to see if I can't find a workaround for us IIS6 users.
FreRange
Posts: 23
Joined: Wed Mar 30, 2005 2:13 pm
Location: Irvine, CA

Re: Single vs. Double quotes with _REQUEST

Post by FreRange »

FreRange wrote:Well after a little expermenting on my side I think that there is something wrong with how thold.php calls graphs.

It all starts around line 106 (I made other changes so I'm not sure of the orginal line number)
<snip>
<img src="graph_image.php?local_graph_id=<?php echo $graph ?>&rra_id=1&graph_start=-32400&graph_height=100&graph_width=300&graph_nolegend=true">
</snip>

It looks like you can get 1 call to graph in this code then IIS6 will no longer produce grahps. You have to restart the IIS service to create any grahps anywhere in the site.

Maybe this should be re-coded to follow the graph_image.php, graph.php and the like. I'm bumping around in the code a little more to see if I can't find a workaround for us IIS6 users.
As of now the work around is to delete that line of code so thold.php does not try to generate that graph.
User avatar
twelzy
Cacti User
Posts: 83
Joined: Wed Mar 30, 2005 6:48 pm
Location: BRAZIL/Brasilia

Delete a threshold without delete the respective data source

Post by twelzy »

Hi mainstreetexpress!

I have the same problem/question here!

Anybody knows how can I delete/remove a threshold from a data source without delete/remove the respective data source itself?!

Thanks in advance!
(And sorry for my poor English!)
markske
Posts: 6
Joined: Fri Mar 18, 2005 2:41 am

Post by markske »

Go to the console
select "Thresholds"
then klik on the number (or ID) of the line you want to delete

Markske
User avatar
twelzy
Cacti User
Posts: 83
Joined: Wed Mar 30, 2005 6:48 pm
Location: BRAZIL/Brasilia

Problems with current values above high threshold!

Post by twelzy »

Hi everybody!

These are the settings for a specific data source:

- High threshold: 45;
- Low threshold: 40;

When the Current value is below the low threshold, or between the high threshold and the low threshold, everything works fine:

- "Console -> Thresholds" status page OK;
- syslog event OK;

When the Current value is above the high threshold:

- "Console -> Thresholds" status page OK;
- syslog event is "restored to normal"!!!;

Any idea?!

Thanks in advance!
-----------

php check-thold.php:
CactiTholdLog[32706]: HOST - XXXXXXXXXXXXXXXX[used] restored to normal with 50 at trigger 1 out of 11

syslog:
Mar 31 10:10:04 (none) CactiTholdLog[32706]: HOST - XXXXXXXXXXXXXXXX[used] restored to normal with 50 at trigger 1 out of 11
Attachments
thold.jpg
thold.jpg (67.87 KiB) Viewed 28081 times
[asm]
Posts: 21
Joined: Sun Apr 03, 2005 5:36 pm

Post by [asm] »

Cactid patch, that mails host state changes :)

use patch -p1 < thold.patch
Attachments
thold.patch.gz
(1.45 KiB) Downloaded 305 times
[asm]
Posts: 21
Joined: Sun Apr 03, 2005 5:36 pm

Post by [asm] »

Same patch for cactid-0.8.6d.
Attachments
cactid-0.8.6d-thold.patch.gz
(1.5 KiB) Downloaded 337 times
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

[asm] wrote:Cactid patch, that mails host state changes :)

use patch -p1 < thold.patch
I use this command and I patched my cactid.
Then I configure my cactid.
After that i use "make" command.
finally i use "make install" command to run my patched cactid but I get these result :
[root@cacti-test cacti-cactid-0.8.6c]# make install
source='util.c' object='util.o' libtool=no \
depfile='.deps/util.Po' tmpdepfile='.deps/util.TPo' \
depmode=gcc3 /bin/sh ./config/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/mysql/include/mysql -g -O2 -c `test -f 'util.c' || echo './'`util.c
util.c:1326: error: conflicting types for 'mail'
util.c:1129: error: previous implicit declaration of 'mail' was here
util.c:1340:2: warning: no newline at end of file
make: *** [util.o] Error 1
Here is cactid/util.c code from line 1326 to 1340:

Code: Select all

void mail(const char* address_list, const char* subject, const char* body) {
	char command[255];
	char message[255];
	
	sprintf(command, "/usr/lib/sendmail %s", address_list);
	FILE* fp;
	fp = popen(command, "w");
	if (fp) {
	    fprintf(fp, "To: %s\n", address_list);
	    fprintf(fp, "Subject: %s\n", subject);
	    fprintf(fp, "\n%s\n", body);
	
	    pclose(fp);
	}
}
I use 0.86.c
What is the problem?
[asm]
Posts: 21
Joined: Sun Apr 03, 2005 5:36 pm

Post by [asm] »

Dunno... i use:
$ cp cactid /usr/local/cactid
(don't start make install)
Locked

Who is online

Users browsing this forum: No registered users and 0 guests