Manage Plugin 0.6.2 for monitoring networks, servers...

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Broken images in Manage plugin

Post by pthaynes »

I am using the manage plugin version 0.6.1 with CactiEZ version 0.6. I noticed that the hide.png and show.png icons in the tree view show as broken images. Looking at the manage.php code I found that the image location specifies a full path relative to your web server. This won't work properly for any Cacti install with a non-default location (CactiEZ puts the Cacti web files in /var/www/html not in a cacti subdirectory).

The solution is to replace the code in the manage.php file that currently says:

Code: Select all

plus.src = "/cacti/plugins/manage/images/themes/<?php echo $theme; ?>/hide.png";
var minus = new Image();
minus.src = "/cacti/plugins/manage/images/themes/<?php echo $theme; ?>/show.png";
with:

Code: Select all

plus.src = "../../plugins/images/themes/<?php echo $theme; ?>/hide.png";
var minus = new Image();
minus.src = "../../plugins/images/themes/<?php echo $theme; ?>/show.png";
Last edited by pthaynes on Tue Apr 21, 2009 6:30 pm, edited 1 time in total.
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Broken link in the Device Edit view with Manage plugin

Post by pthaynes »

I am using the manage plugin version 0.6.1 and CactiEZ version 0.6. When I go into Console > Devices (the one under management) > click on one of the devices and then scroll down to the "PHP Network Managing Options - Current host status" section I see an icon with the correct status.

If I hover over that icon I see a broken link. With a network sniffer I found that the item that the browser is requesting is:
/cacti/plugins/manage/manage_weathermap_gd.php

For my installation that should be:
/plugins/manage/manage_weathermap_gd.php

I can't seem to find where that path is being formed in the code (coding is not my forte) so I am guessing part of the path at least is being formed by concatenating variables.

Could someone please tell me where I need to change the setting to show the current root of my Cacti install, or where I need to edit the plugin code to make it work?

Thanks in advance.
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Broken link in the Device Edit view with Manage plugin

Post by pthaynes »

I'll answer my own question. In the setup.php file there is a line that specifies the following:

Code: Select all

$manage_header='PHP Network Managing Options - Current host status : <img src="./plugins/manage/images/themes/'.$theme.'/'.$manage_host["statut"].'.png" border="0" align=absmiddle onmouseover="return overlib(\'<img src=/cacti/plugins/manage/manage_weathermap_gd.php?id='.$_GET["id"].'&fake=\' + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + \'>\', WRAP)" onMouseOut="nd();">';  
I believe it should be replaced with this:

Code: Select all

$manage_header='PHP Network Managing Options - Current host status : <img src="./plugins/manage/images/themes/'.$theme.'/'.$manage_host["statut"].'.png" border="0" align=absmiddle onmouseover="return overlib(\'<img src=./plugins/manage/manage_weathermap_gd.php?id='.$_GET["id"].'&fake=\' + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + (Math.floor(Math.random()*4)+2) + \'>\', WRAP)" onMouseOut="nd();">';  
Once I made the replacement the icon worked again. It seems there are also some absolute paths that need to change to relative paths in the hosts.php files under each of the patch architecture directories.
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Status in the Manage tab

Post by pthaynes »

I have manage version 0.6.1 and thold version 0.4.1 running on cacti version 0.8.7c. When I click on the manage tab I see my hosts in a tree view. The icon next to my hosts ALWAYS appear as either a green tick, yellow exclamation mark or red down arrow. I have some thresholds setup on my hosts and purposely setup one to always breach so I could make sure that thresholds were working. I never see the orange exclamation mark for thresholded hosts. If I click on my thold tab I see the thresholds as breached. Is there something that I need to do to make the threshold breaches show up on the manage tab?

I have noticed that when the threshold is breached and I am using a view other than the tree view on the manage tab I see the hostname and address in red. The name only shows up in blue when using tree view.

Thanks in advance for any help.
Last edited by pthaynes on Sat Apr 25, 2009 4:42 am, edited 1 time in total.
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Syslog messages from manage

Post by pthaynes »

I have manage version 0.6.1 and thold version 0.4.1 running on cacti version 0.8.7c. I receive syslog messagees roughly once a minute saying that a reboot was detected for some of my hosts. The hosts have not rebooted. The hosts are linux servers. Are there any configuration changes I need to make to ensure that the reboots are not falsely reported?

Thanks in advance for any help.
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Status in the Manage tab

Post by pthaynes »

I don't know if it helps, but when I look at the host in mysql using:

Code: Select all

select * from manage_host where host_id = 196;
(196 is the host number for one of the hosts that has the breached threshold) it shows the statut as up.

I would have thought that should show as treshold (based on some of the code in the manage_check.php). I set the statut in mysql to treshold using:

Code: Select all

UPDATE manage_host SET statut = 'treshold' where id=196;
The icon next to that host then disappeared (the image was none.png). Within a few moments it changed back to the green tick (up.png).

I am guessing that means there are two problems:
  • 1. The status is getting set back to up by the manage polling.
    2. The icon being picked for threshold exceeded is going to none.png
Is this a known bug, or is there something I am missing?

Thanks for any help.
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Status in the Manage tab

Post by pthaynes »

I'll half answer my own problem. It looks like the threshold is supposed to show when a host has been down for a while, but has not yet been down for the number of polls in the threshold.

The threshold breaches gained from the thold plugin only impacts the colour of the text for that host in the manage tab (and if it blinks or not optionally), and even then that does not show up in the tree. Looking at the code again I can understand why - it looks like changing the icon that appears would be easier than changing the colour of the text in tree view.

Just a random thought, but should the icon for a threshold breach indicated by the thold plugin change the icon to a yellow exclaimation mark (since it should have a similar level of impact to a service being unavailable)? It could also be handy to show a little red or green blob in the detail or list views similar to the ones for services. Maybe the threshold one could be labelled Threshold and be used to indicate any breached threshold.

I might tinker with the code and see if I can make that work.
DimmON
Posts: 14
Joined: Thu Apr 02, 2009 3:05 am

[Solved]Service state problem!!!

Post by DimmON »

Hello,
I wish to supervise the state of Windows host`s services and ports by Manage Plugin.
I have installed Manage plugin and TCP template. TCP ports monitoring works fine. Services monitoring in "manage" does not work correctly.
Host return service state = "1" (you can see it on the first picture), but in "manage" tab i see a red icons. (second picture).

I do not understand what is a problem... Please help me to solve it!!!

Problem have been solved
It is necessary to delete all graphs of windows services and create it again.
Cacti Version - 0.8.7d
Plugin Architecture - 2.4
Poller Type - Cactid v
Server Info - Linux 2.6.9-78.0.13.plus.c4smp
Web Server - Apache/2.0.63 (CentOS)
PHP - 5.1.6
PHP Extensions - libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, SPL, shmop, session, Reflection, pspell, posix, mime_magic, iconv, hash, gmp, gettext, ftp, exif, date, curl, ctype, calendar, bz2, zlib, pcre, openssl, apache2handler, gd, ldap, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, snmp, eAccelerator
MySQL - 5.0.68
RRDTool - 1.2.23
SNMP - 5.1.2
Plugins
  • Thresholds (thold - v0.4.1)
    Global Plugin Settings (settings - v0.5)
    Large Site Performane Booster for Cacti (boost - v2.2)
    PHP Network Managing (PHP Network Managing - v0.6.1)
    Network Discovery (discovery - v0.8.5)
    Network Tools (tools - v0.3)
    Syslog Monitoring (syslog - v0.5.2)
    Device Tracking (mactrack - v1.1)
    Login Page Mod (loginmod - v1.0)
    Update Checker (update - v0.4)
    FlowView (flowview - v0.6)
    Host Info (hostinfo - v0.2)
    Error Images (errorimage - v0.1)
    PHP Network Weathermap (weathermap - v0.96a)
    docs
    Cacti-ReportIt (reportit - v0.6.1)
    Router Configs (routerconfigs - v0.1)
    WMI Query (wmi - v0.1)
    Realtime for Cacti (realtime - v0.35)
Attachments
Cacti -&amp;gt; Manage
Cacti -&gt; Manage
pic2.JPG (46.68 KiB) Viewed 8539 times
Cacti -&amp;gt; Graphs
Cacti -&gt; Graphs
pic1.JPG (71.94 KiB) Viewed 8539 times
Last edited by DimmON on Tue May 26, 2009 1:50 am, edited 2 times in total.
User avatar
Gabriel
Posts: 28
Joined: Sun Jan 04, 2009 7:08 pm
Location: Auckland, NZ

I don't like host down email alerts coming every 5 minutes..

Post by Gabriel »

How can I change the behavior so that it sends out 1 email when it is down...and only send another email when the device is back up?

Currently I think the manage plugin is checking every 5 minutes and send out email saying it's down..I have whole bunch of device down emails out of a single device.

Another question, does manage poll every 5 minutes? or it follows cacti poller (I've set it to 1 minute polling)?

Cheers,
Gabriel
DimmON
Posts: 14
Joined: Thu Apr 02, 2009 3:05 am

show linux processes in Manage

Post by DimmON »

Now I have an another problem.
It is necessary for me to show linux processes in Manage plugin like windows processes. But I don`t understand how can I do this...
Any ideas?...
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Manage plugin and defaults

Post by pthaynes »

I noticed that the auto-refresh on the manage page only works once if you do not set a refresh value on your user account. I had asumed it would use the default value of 5 seconds. It seems that the default value is plugged in programatically each time the page loads - defaults are not placed in the mysql database.

Could I suggest that checking if there is a value in the mysql database and then plugging in a default if there is none set would be more appropriate in the setup script? Alternatively this could be done in the manage_settings.php file.

Another question on a similar topic - would it be possible to add an option to change manage settings for ALL users? I have a number of users and such an option would make initial setup a lot easier.
Stunty
Posts: 21
Joined: Sun Jun 08, 2008 11:32 am
Location: France

Post by Stunty »

Hi I just installed the plugin on my cactiEZ 0.6 using centos and I have an error.
Cacti info :
Cacti Version - 0.8.7c
Plugin Architecture - 2.2
Poller Type - Cactid v
Server Info - Linux 2.6.9-78.0.22.plus.c4
Web Server - Apache/2.0.63 (CentOS)
PHP - 5.1.6
PHP Extensions - libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, SPL, shmop, session, Reflection, pspell, posix, mime_magic, iconv, hash, gmp, gettext, ftp, exif, date, curl, ctype, calendar, bz2, zlib, pcre, openssl, apache2handler, gd, ldap, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, snmp, eAccelerator
MySQL - 5.0.68
RRDTool - 1.2.23
SNMP - 5.1.2
Plugins
  • Global Plugin Settings (settings - v0.5)
    Large Site Performane Booster for Cacti (boost - v2.2)
    Device Monitoring (monitor - v0.8.2)
    Network Discovery (discovery - v0.8.5)
    Network Tools (tools - v0.3)
    Syslog Monitoring (syslog - v0.5.2)
    Device Tracking (mactrack - v1.1)
    Login Page Mod (loginmod - v1.0)
    Update Checker (update - v0.4)
    FlowView (flowview - v0.6)
    Host Info (hostinfo - v0.2)
    Error Images (errorimage - v0.1)
    PHP Network Weathermap (weathermap - v0.95b)
    docs
    Cacti-ReportIt (reportit - v0.6.1)
    NTop Viewer (ntop - v0.1)
    SSL Redirector (ssl - v0.1)
    Router Configs (routerconfigs - v0.1)
    WMI Query (wmi - v0.1)
    Realtime for Cacti (realtime - v0.35)
    PHP Network Managing (PHP Network Managing - v0.6.1)
Attachments
Screenshot-Cacti - Mozilla Firefox.png
Screenshot-Cacti - Mozilla Firefox.png (168.8 KiB) Viewed 8235 times
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Status in the Manage tab for thresholds

Post by pthaynes »

I have had a bit more of a look at the code in manage_check.php to try and get the thresholds (the ones from thold) to change things in the tree view. After a bit of a think I decided that I would set the status to "problem" when a threshold is triggered. My code is just a quick fix (I just added it in as a final "if" statement). I added the following lines after line 308:

Code: Select all

if ( ($host_statut == 'up') && (db_fetch_cell("select host_id from thold_data where thold_fail_count >= thold_fail_trigger and host_id = '".$host['id']."'and thold_enabled = 'on' ") ) ) {
          $global_statut="prob";
            db_execute("UPDATE manage_host SET statut = '".$global_statut."' where id='" . $host["id"] . "'");
    }
Feel free to use it. It doesn't update the manage events, mainly because I didn't know how I would say which threshold was breached. Anyway I figured I would look at the syslog to find any threshold events.
DimmON
Posts: 14
Joined: Thu Apr 02, 2009 3:05 am

Post by DimmON »

I have one more question. It is very important for me:
How can I do only host down notification without the windows services down message if the host is down?
jmax
Posts: 10
Joined: Thu Nov 06, 2008 7:12 am
Location: Guildford, United Kingdom

Post by jmax »

I have run into a possible problem.

When using Cacti poller + poller_output under Manage and select "Ping or SNMP" for the Downed Host Detection, manage doesn't refresh the status of the devices. It is working fine when selecting "Ping and SNMP" but not with "Ping or SNMP".

Digging a bit into the code and checking the content of the DB, the problem is coming from the fact that "Ping or SNMP" is getting value 4 under "availability_method" and manage_check.php doesn't have any condition matching this method.

I have modified the following in the code:

Code: Select all

 if ( ($host["availability_method"] == "1") || ($host["availability_method"] == "2") ) { 
with

Code: Select all

 if ( ($host["availability_method"] == "1") || ($host["availability_method"] == "2") || ($host["availability_method"] == "4") ) {  
And it seems to work.

May be Gilles could verify if nothing else is required and include into Manage 6.2?

Merci encore for this plugin. It is great. :)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests