Thresholds not triggering

Support questions about the Threshold plugin

Moderators: Developers, Moderators

dewadragoon
Posts: 12
Joined: Sat Jan 08, 2011 4:51 am

Re: Thresholds not triggering

Post by dewadragoon »

llull wrote:NOW SOLVED !!!!

I was experiencing the same problem: thresholds not triggering after upgrade of thold to 0.4.3 or 0.4.4.

The problem seemed in the conversion of the graph which has to be sent by email, and was related to PHP, as it is used for converting PNG -> JPG.

To make THOLD trigger working again (and email to be sent) I only made a modification in PHP.INI, adding the red row:

; Directory in which the loadable extensions (modules) reside.
extension_dir ="C:\PHP\ext"
extension=php_mysql.dll
extension=php_snmp.dll
extension=php_sockets.dll
extension=php_gd2.dll

Now, my THOLD (0.4.4-41) is triggering again with email sent all right, but the graph is not converted and in the body of the email there is no graph, only an error message.

My php.log file (has to be activated in the php.ini) shows:

[15-Apr-2011 17:28:50] PHP Warning: Missing argument 4 for rrdtool_function_graph(), called in C:\Programmi\Apache2\htdocs\cacti\plugins\thold\thold_functions.php on line 1504 and defined in C:\Programmi\Apache2\htdocs\cacti\lib\rrd.php on line 523
[15-Apr-2011 17:28:50] PHP Notice: Undefined variable: rrdtool_pipe in C:\Programmi\Apache2\htdocs\cacti\lib\rrd.php on line 545
[15-Apr-2011 17:28:51] PHP Warning: fopen(/tmp/1302881331.png): failed to open stream: No such file or directory in C:\Programmi\Apache2\htdocs\cacti\plugins\thold\thold_functions.php on line 1697
[15-Apr-2011 17:28:51] PHP Warning: fwrite(): supplied argument is not a valid stream resource in C:\Programmi\Apache2\htdocs\cacti\plugins\thold\thold_functions.php on line 1698
[15-Apr-2011 17:28:51] PHP Warning: fclose(): supplied argument is not a valid stream resource in C:\Programmi\Apache2\htdocs\cacti\plugins\thold\thold_functions.php on line 1699
[15-Apr-2011 17:28:51] PHP Warning: imagecreatefrompng(/tmp/1302881331.png): failed to open stream: No such file or directory in C:\Programmi\Apache2\htdocs\cacti\plugins\thold\thold_functions.php on line 1702
[15-Apr-2011 17:28:51] PHP Notice: Undefined variable: imgname in C:\Programmi\Apache2\htdocs\cacti\plugins\thold\thold_functions.php on line 1711
[15-Apr-2011 17:28:51] PHP Warning: unlink(/tmp/1302881331.png): No such file or directory in C:\Programmi\Apache2\htdocs\cacti\plugins\thold\thold_functions.php on line 1721


The problem now is related to graph conversion.

Any idea on how to solve it?

tnx
llull
Wow that's great.. i'll try it out...

thanks for the info..
area62
Posts: 4
Joined: Thu Jan 06, 2011 8:44 am

Re: Thresholds not triggering

Post by area62 »

I also experience the same problems, thold is not triggering at all!

I tried the following:

thold-0.4.1 - couldn't add thresholds
thold-0.4.3 - not triggering
thold-0.4.4-41 - not triggering

My setup is as follows:

- PHP 5.3.6 (with GD and everything)
- Cacti 0.8.7g
- PA started with 2.8 later patched to 2.9 (not sure if that went ok)
- NPC plugin 2.0.4
- Settings plugin 0.7
- Currently thold plugin 0.4.3

Things that i already tested/tried:

1) I see that there are some PNG images in my /tmp folder but they do not go away. I suspect it goes wrong in the png2jpeg function...
2) I checked /var/log/messages (tried Daemon and Syslog option), /var/log/maillog and /var/log/php_log but nothing (suspicious) about thold is in there...
3) I receive test e-mails

Thanks in advantage!
llull
Posts: 2
Joined: Fri Apr 15, 2011 10:41 am

Re: Thresholds not triggering

Post by llull »

As the problem seems to be related to Graph conversion from PNG format to JPG,

you could disable this conversion, by substituiting the statement in the PNG script with the old one (for example, the one of Thold 0.4.1); This way:

You have to modify the THOLD_FUNCTIONS.PHP
// $data = png2jpeg(rrdtool_function_graph($val['local_graph_id'], $val['rra_id'], $graph_data_array));
$data = rrdtool_function_graph($val['local_graph_id'], $val['rra_id'], $graph_data_array);
and a couple os rows below, do the same thing but with other statements; this way
// if ($Mailer->attach($data, $val['filename'].'.jpg', 'image/jpg', 'inline', $cid) == false) {
if ($Mailer->attach($data, $val['filename'].'.png', 'image/png', 'inline', $cid) == false) {
In this mode, you'll have your graphs in the PNG format (as before) and everything will work againg.

Please let me know if you reached your goal

CIAO
llull
area62
Posts: 4
Joined: Thu Jan 06, 2011 8:44 am

Re: Thresholds not triggering

Post by area62 »

Thanks, that worked for me!

I don't understand why the convert doesn't work. I compiled PHP with GD2 (including libjpeg and libpng) and when i test the functionality (png2jpeg function) from the command line i don't get any errors.
User avatar
willieb
Cacti User
Posts: 160
Joined: Thu Jan 22, 2009 10:09 am
Location: South GA

Re: Thresholds not triggering

Post by willieb »

Thanks so much for this thread. It helped me a lot.

I couldn't get thold to work even with an unfortunate fresh cacti install as I had over 100 titled graphs.

Anyway, I ended up finding some missing php extensions and did the png to jpeg fix.

Thold works great now! Thanks again.

The only issue that it seems I have left is my plugins don't auto import the plugin sql files. I do them manually which is fine for now. I have a post for that so we'll see how it goes...
-willieb
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Thresholds not triggering

Post by TheWitness »

As I can see, this issue is resolved in 0.4.6
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests