Manage Plugin 0.6.2 for monitoring networks, servers...

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

MANAGE 0.5.1 Mail Bug

Post by mcutting »

Gilles,

I have found a bug in the way manage_check.php handles global and private mail sending.

Line 478 reads:

$alert_address .= ";".$global_alert_address;

This causes all the alerts to fail. I changed it to

$alert_address .= ",".$global_alert_address;

This makes it work again.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
Pax
Posts: 2
Joined: Thu May 17, 2007 10:02 am

Problems getting the poller to run

Post by Pax »

Hey Gilles,

This is a great addon to Cacti. I am using V0.51, and have gone through a few of the fixes that have been listed to get V5 work with PHP5, and I had to create some of the tabes although this was a fresh install, but I'm stuck on one thing... getting the poller to actually run.

I've got it using the Cacti poller, and it is using cmd.php.

I'm using 0.86j, V1.1 of plugin architecture on Redhat ES 5. I don't know if it is related to the error in my php log

Code: Select all

[17-May-2007 16:05:34] PHP Notice:  Undefined index:  site in /var/www/html/cacti/plugins/manage/manage.php on line 154
which is

Code: Select all

print "&site=" . $_REQUEST["site"];
.

Normal graphing, is working fine, but manage shows "Last poll date : 0" I've managed to force the HDD threshhold to break and the host name flashes in Manage, so I can see that part is working, but the services, TCP ports and processes don't seem to poll.

Any ideas?

Pax
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I suppose this is related: In my fresh install, the table "manage_sites" is not installed. I received two error during install (but I did not write them down) at the web gui.
I copied the create statement out of setup.php and run it from mysql console. Now it seems to work.
Reinhard
Pax
Posts: 2
Joined: Thu May 17, 2007 10:02 am

Post by Pax »

gandalf wrote:I suppose this is related: In my fresh install, the table "manage_sites" is not installed. I received two error during install (but I did not write them down) at the web gui.
I copied the create statement out of setup.php and run it from mysql console. Now it seems to work.
Reinhard
I too had many tables that were not auto created, so I extracted the statements from the sql script files and manually ran them through phpmyadmin.

Everything seems to be there now from those statements, but obviously it is hard to tell. When I do the check it shows all the tables as being there, but I don't know if the script checks table availability or the structure of the table too

Pax
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

There's code for table checking, but I assume there's an initialization problem that prevents correct execution. But I did not dig deeper into that
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Now I found "Invalid default value for 'services'" displayed when resetting everything to default (remember table "Settings"!).
This is related to

Code: Select all

CREATE TABLE manage_host_services(
id mediumint( 8 ) unsigned NOT NULL default '0',
services mediumint( 8 ) unsigned default '',
statut text
services is defined as integer but default value is a string. I changed default to '0'

Next Item is

Code: Select all

Duplicate entry 'manage_thold' for key 1
This is simply a duplicate an can be omitted, IMHO.

Next item I came across was "Devices" under "Device Management". When I change "Select Site" and save it, nothing changes. It is simply ignored. But I could not find the solution yet.
Unfortunately, not a single host is now displayed under MANAGE tab, be it up or down. I'm at a loss
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Problems getting the poller to run

Post by gandalf »

Pax wrote:Hey Gilles,

This is a great addon to Cacti. I am using V0.51, and have gone through a few of the fixes that have been listed to get V5 work with PHP5, and I had to create some of the tabes although this was a fresh install, but I'm stuck on one thing... getting the poller to actually run.

I've got it using the Cacti poller, and it is using cmd.php.

I'm using 0.86j, V1.1 of plugin architecture on Redhat ES 5. I don't know if it is related to the error in my php log

Code: Select all

[17-May-2007 16:05:34] PHP Notice:  Undefined index:  site in /var/www/html/cacti/plugins/manage/manage.php on line 154
which is

Code: Select all

print "&site=" . $_REQUEST["site"];
.

Normal graphing, is working fine, but manage shows "Last poll date : 0" I've managed to force the HDD threshhold to break and the host name flashes in Manage, so I can see that part is working, but the services, TCP ports and processes don't seem to poll.

Any ideas?

Pax
Replace this line by

Code: Select all

print "<option value='manage.php?group=999";
if (isset($_REQUEST["simple"])) {
	if (isset($_REQUEST["site"])) {
		if ($_REQUEST["site"] <> "0") {
			print "&site=" . $_REQUEST["site"];
		}
	}
}
and all is well (hmm, at least, _this_ error is gone). still can't see any managed device, sigh
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Misery is going on. "Device managing" -> "Device" -> Select a device and change TCP Ports Template. Save. Revisit the host: TCP Ports Template is again at "None".
What the hell is going on here?
Reinhard
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Gandolf,

I would be willing to "certify", with Gilles maintaining his copyright this time :oops: . However, only when he thinks he is "done" and only when he asks...

Larry
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?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yeah, I try to find a solutiuon for thresholding AND alerting on downed host USING cactid!

Currently, this seems to require THOLD for thresholding (yep, you won't believe :wink: ) and MANAGE for downed hosts. But I can't get MANAGE up and running. Functionality of 0.51 has increased significantly, so I want to use it. But it seems to be buggy, still
Reinhard
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Gandalf - you can use poller-manage.php as a seperate task. I've tried this with cactid, and it seems to work fine.

I ended up inserting the sql files one by one into phpmyadmin to get Manage to work.

I have it running, and can provide an sql dump if you wish ?
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

mcutting wrote:I was looking at the overlib you have in the screenshots, but can't seem to find this on the version I have
"right click" on the up/down images
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

mcutting wrote:Gandalf - you can use poller-manage.php as a seperate task. I've tried this with cactid, and it seems to work fine.
Yes, I've run it several times from cli during testing process. And now it's configured from "Settings". Still I can't see any single object at the MANAGE tab.
I ended up inserting the sql files one by one into phpmyadmin to get Manage to work.

I have it running, and can provide an sql dump if you wish ?
That's what I was thinking about, too. But then I decided to try debugging. And at least two errors were found (see above). Perhaps my fixes are wrong; I did not dive deep enough into the code. And as usual (yes, my plugins are not documented either), table structure and columns are not documented. So the fixes are only a guess.
But I really would like to have a dump of your manage_* tables and of all items of settings table with name like "manage%".
Then I will compare them to my settings.
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Analyzing code of manage_list.php around line 1136, I found the following

Code: Select all

  $vv = db_fetch_cell("SELECT value FROM settings where name='path_webroot'");

  $port_number=array();
  $port_name=array();
  $filename = $vv.'/scripts/ports.inc';
  if (is_readable($filename)) {
    $u=0;
    $lines = file ($filename);
    foreach ($lines as $line) {
      $v = explode("#",$line);
      $port_number[$u]=trim($v[0]);
      $port_name[$u]=trim($v[1]);
      $u++;
    }
  }
It searches for a file named ports.inc in the scripts directory. There's no such file within the distributed tarball of MANAGE. And I found no hint on how to define such a file. Nor do I know, whether this file is mandatory and what it servers for. Sure, it seems to define sth. for TCP Ports, but what exactly?
Please find a screenshot attached.
From reading the code, I assume that it is required to define at least a single TCP port to make manage work (my goal is "downed host detection" when using cactid as a poller; sth. that THOLD seems not to be able to handle); can anyone please confirm my assumption?
Perhaps still one of the tables is screwed up to prevent me from defining anything meaningful here?
Reinhard
Attachments
Screenshot of a Device
Screenshot of a Device
manage_list.png (28.98 KiB) Viewed 3904 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

A little step further, but still no clue:
I defined a site and a group within that site. I associated the host first with that site, save, ok. Then I associated the group, save, ok. Then "Force ping ...", save, ok. Last "TCP Ports Template", save. But when displaying again, the TCP Template has gone.
But this time, I checked the table manage_host and I found the list of ports in there; see screenshot.
But still I suppose it would be better to see it on the screen and not only in the table.
And still, when checking the MANAGE tab, everythings empty. In fact, too empty this time (see 2nd image attached).
Reinhard
Attachments
TCP Ports seen in table manage_host
TCP Ports seen in table manage_host
manage_host_table.png (11.23 KiB) Viewed 3945 times
Weird error when displaying the MANAGE tab
Weird error when displaying the MANAGE tab
manage_tab.png (33.92 KiB) Viewed 3945 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests