Update request for MONITOR plugin
Moderators: Developers, Moderators
- AndyStewart
- Cacti User
- Posts: 102
- Joined: Thu Sep 29, 2005 5:21 am
- Location: Edinburgh, Scotland
Update request for MONITOR plugin
Can the images for the hosts be hyperlinked to their graph pages?
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!
[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Moved to Addons
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Seems a reasonable request.
Add a ticket as a Feature Request to the bug tracker located here
http://cactiusers.org/bugs/
and I will get to it when I get the chance.
Add a ticket as a Feature Request to the bug tracker located here
http://cactiusers.org/bugs/
and I will get to it when I get the chance.
Update request for MONITOR plugin
It's not difficult to reach this with some simple changes. I managed to do it in a short time during this afternoon and now is working for me. So in the meantime that cigamit publish a new official version of the monitor plugin with this feature you can try to do the following steps:
1. Open for editing the "monitor.php" file under the /plugins/monitor folder
(it's always a good idea to maintain a backup copy of the original file).
2. Locate the line with the following code:
Then replace it with the following line:
(note that we're simply adding the id field to the select statement).
3. Locate the lines with the following code:
...and insert the following extra line:
(we create a new $anchor variable to be used later).
4. And finally, locate the line who says:
...then replace it with the following code:
(here is when we're creating the anchor corresponding to each icon, but trying to maintain the original aspect of the page).
Save your modified file (as "monitor.php", do not rename it), refresh your monitor tab ...et voila! It works for me
For sure you're thinking that it would be easier if I post my modified monitor.php file, but I prefer not to do this, because I think my installed monitor plugin is an outdated version and maybe it can cause compatibility problems to others.
Good luck.
Bernardo
1. Open for editing the "monitor.php" file under the /plugins/monitor folder
(it's always a good idea to maintain a backup copy of the original file).
2. Locate the line with the following code:
Code: Select all
$sql = "SELECT description, status, hostname, cur_time, status_rec_date, availability FROM host where disabled = '' and monitor = 'on' ORDER BY description";
Code: Select all
$sql = "SELECT id, description, status, hostname, cur_time, status_rec_date, availability FROM host where disabled = '' and monitor = 'on' ORDER BY description";
3. Locate the lines with the following code:
Code: Select all
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
// Loop through each host one by one
$name = $row['description'];
$status = $row['status'];
...
...
etc.
Code: Select all
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
// Loop through each host one by one
$anchor = $config['url_path'] . "graph_view.php?action=preview&host_id=" . $row['id'];
$name = $row['description'];
$status = $row['status'];
...
...
etc.
4. And finally, locate the line who says:
Code: Select all
print "<td valign=top><center><img src='images/$i' name='$name' id='$name' title='$title'><br>$s$name$s2</center></td>\n";
Code: Select all
print "<td valign=top>
<center>
<a href=$anchor>
<img src='images/$i' name='$name' id='$name' title='$title' border='0'><br>
<font color='black'>$s$name$s2</font>
</a>
</center>
</td>\n";
Save your modified file (as "monitor.php", do not rename it), refresh your monitor tab ...et voila! It works for me
For sure you're thinking that it would be easier if I post my modified monitor.php file, but I prefer not to do this, because I think my installed monitor plugin is an outdated version and maybe it can cause compatibility problems to others.
Good luck.
Bernardo
Who is online
Users browsing this forum: No registered users and 0 guests