Im using the monitor plugin, witch plays an alarm sound when a host goes down.
When there's a threshold reached, the host turns orrange.
Is there a posibility to play (another) alarm sound when a threshold is reached?
Alarm Sound when Threshold reached
Moderators: Developers, Moderators
wrong forum, moving.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Re: Alarm Sound when Threshold reached
Still looking for this functionality. Anyone?
Re: Alarm Sound when Threshold reached
That's interesting a little. I tried to add code for Thold 0.4.1.
In function tholds() of 'plugins/thold/thold_graph.php',
before the line 267: '/* build the SQL query and WHERE clause */'...(Sorry, I borrowed sound file from monitor plugin :-) Please replace the file you like.)
At the result, when triggered, will be changed like as (with alarm): Click the alerting message to stop alarm.
(But this behavior depends browser. I tested with IE(6) on Windows. With Chrome, it can't be stopped, but played only 1 time.)
// Sorry my English..
In function tholds() of 'plugins/thold/thold_graph.php',
before the line 267: '/* build the SQL query and WHERE clause */'...
Code: Select all
/* embedding alarm */
$alarm_sql = "SELECT * FROM thold_data
LEFT JOIN user_auth_perms ON (
(thold_data.graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION['sess_user_id'] . ") OR
(thold_data.host_id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION['sess_user_id'] . ") OR
(thold_data.graph_template=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION['sess_user_id'] . "))
WHERE thold_alert!=0 AND (thold_fail_count >= thold_fail_trigger)";
$alarm = sizeof(db_fetch_assoc($alarm_sql));
if ($alarm) {
$alarm_sound = $config['url_path'] . 'plugins/monitor/sounds/attn-noc.wav';
print "<embed name='alarm' src='" . $alarm_sound . "' autostart='true' loop='true' volume='100' hidden='true'></embed>";
print "<noembed><bgsound src='" . $alarm_sound . "'></noembed>";
print "<table width='100%' border='0' cellspacing='0' cellpadding='5'><tr>";
print "<td style='text-align:center; background-color:#" . $thold_bgcolors['red'] . ";'>";
print "<a href='#' onClick='javascript:alarm.stop()'>";
print "<strong>$alarm threshold(s) triggered!</strong>";
print "</a></td></tr></table><br>";
}
At the result, when triggered, will be changed like as (with alarm): Click the alerting message to stop alarm.
(But this behavior depends browser. I tested with IE(6) on Windows. With Chrome, it can't be stopped, but played only 1 time.)
// Sorry my English..
Re: Alarm Sound when Threshold reached
Hey dude. Thank you very much. Your "hack" works perfect for me.
I know, this post is 3 years ago, but I really appreciate it and Im saying thanks.
He deserves it.
I know, this post is 3 years ago, but I really appreciate it and Im saying thanks.
He deserves it.
Who is online
Users browsing this forum: No registered users and 1 guest