Manage Plugin 0.6.2 for monitoring networks, servers...

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

torstentfk wrote:At console->Managing->Devices after selecting one:
"Services :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/cacti/plugins/manage/list.php on line 967"
which PHP and MYSQL versions ?

can you change line 957 with this one :

Code: Select all

data_local.host_id='".$_GET['id']."'";
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

gilles wrote:
torstentfk wrote:At console->Managing->Devices after selecting one:
"Services :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/cacti/plugins/manage/list.php on line 967"
which PHP and MYSQL versions ?

can you change line 957 with this one :

Code: Select all

data_local.host_id='".$_GET['id']."'";
User avatar
bonbon
Posts: 7
Joined: Thu Sep 07, 2006 12:37 pm
Location: Minneapolis, MN

Post by bonbon »

In regards to 0.4.2 :

In setup.php:99


I need to change

CREATE TABLE manage_host_services ( id mediumint(8) unsigned NOT NULL default '0', services mediumint(8) unsigned default '', statut text)"

to

CREATE TABLE manage_host_services ( id mediumint(8) unsigned NOT NULL default '0', services mediumint(8) unsigned default null, statut text)"

Creating a table with a default value of '' wasn't accepted in mysql 5.0.22. Not sure if this is a bug in mysql...
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

i don't know : i have mysql 5.0.22 too
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

gilles wrote:
torstentfk wrote:At console->Managing->Devices after selecting one:
"Services :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/cacti/plugins/manage/list.php on line 967"
which PHP and MYSQL versions ?

can you change line 957 with this one :

Code: Select all

data_local.host_id='".$_GET['id']."'";
done. no difference but the error changed:
PHP: PHP 5.1.4 (cli) (built: Jul 20 2006 14:03:08)
MYSQL: mysql-4.1.15



changed files with dos2unix to get rid of line feed.
Now changing os-type i get this.
"1
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/cacti/plugins/manage/list.php:137) in /var/www/html/cacti/plugins/manage/list.php on line 207"
saveing the type infos is working - I think this is an debug info from developing?

Code from list.php:
134 db_execute("delete from manage_alerts where idh='" . $selec ted_items[$i] . "'");
135 }
136 }elseif ($_POST["drp_action"] == "8") { //
137 print "1";
138 for ($i=0;($i<count($selected_items));$i++) {
139 input_validate_input_number($selected_items[$i]);
140
141 $sql3 = "SELECT manage FROM host where id='" . $selected_items[$i] . "'";
142 $result3 = mysql_query($sql3);


- selecting only a template without OS-type removes the type form the device.


Torsten
SteveIs4Cacti
Posts: 13
Joined: Fri Jun 09, 2006 10:09 am
Location: South Carolina

Uptime showing 0's

Post by SteveIs4Cacti »

After updating to 4.2, my uptime is showing 0's for every device. Is there a quick fix or change I can do to resolve this? Thanks for any help.
SteveIs4Cacti
Posts: 13
Joined: Fri Jun 09, 2006 10:09 am
Location: South Carolina

Found my problem with uptime. Please disreguard previous

Post by SteveIs4Cacti »

Found the issue with my previous uptime issue. Changed to SNMP and it worked.
SteveIs4Cacti
Posts: 13
Joined: Fri Jun 09, 2006 10:09 am
Location: South Carolina

False Positives on Up and Down alerts

Post by SteveIs4Cacti »

I am getting false positives on the up and down alerts. When I receive an alert that a site or server is down and then check in Cacti and via ping, the site is up and had not gone down. Is there a way to check and see what is causing this to report? Great plugin!
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

torstentfk wrote:Hi,

installed 0.4.2 and I got this behavior:
In full display mode the device names below the pictures are not always displayed. I also get some red blinking names.
I found the bugs:
near the code:

Code: Select all

if ($row6["thold_fail_count"] >= $row6["thold_fail_trigger"]) {
          $td=2;
If you use the thold-default values the fail_trigger is NULL, so always an error is displayed.

The disapearing names:
The code

Code: Select all

f ($td == 1) {
  ?>
  <DIV ID="calque1" STYLE="visibility:visible"><font color="yellow"><b><?php print $msg; ?></div>
  <?php
}

if ($td == 2) {
  ?>
  <DIV ID="calque2" STYLE="visibility:visible"><font color="red"><b><?php print $msg; ?></div>
  <?php
is the correct one: the style must not be hidden, it must be visible!


Greetings
Torsten
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

Hey Steveis4Cacti.......I get alot of these alerts also....Maybe false alert - Reboot event detected for host [xxx] whatever.. I wonder if anyone else is getting these and why ?? It seems to be pretty frequently...i have about 15 router/switches in manage so far and 1 server...it seems to me only to be the switches and port 23?? Any ideas??

Thanks
scottsta
Posts: 9
Joined: Sat Jun 17, 2006 9:58 am

Manage Tables Deleted..

Post by scottsta »

Hi - I went in and deleted the manage tables (dont ask me why)

when trying to reinitialise manage - I get the message that the tables couldnt be found... (I did try removing the manage plugin from the config.php file in order to get the uninstall.sql to run).

Whats the best way to resetup manage, and to get the tables to re-create ?

thanks in advance..
nire
Posts: 1
Joined: Fri Sep 22, 2006 4:21 am
Location: Netherlands

fixed my mysql_fetch_row() error

Post by nire »

I got several mysql_fetch_row() errors.

I managed to narrow it down to the cacti.manage_host_services table. It did not exist.

In the list.php code I added
if ($row3 = mysql_fetch_array($result3, MYSQL_ASSOC)) {
return $row3;
} else {
print (mysql_error());
}
before the line that gave the error. This gave me a clear description of the MySQL error (table cacti.manage_host_services doesn't exist).

I logged on to the cacti server and went into the MySQL environment:
"mysql cacti -u root -p"

followed by:
"CREATE TABLE manage_host_services ( id mediumint(8) unsigned NOT NULL default '0', services mediumint(8) unsigned NOT NULL default '0', statut text);"

The error message disappeared and all is working OK now.

I'm using:
PHP 5.1.4
MySQL 5.0.22
joshm
Cacti User
Posts: 82
Joined: Mon Oct 03, 2005 1:34 pm
Location: STL

Post by joshm »

torstentfk wrote:
torstentfk wrote:Hi,

installed 0.4.2 and I got this behavior:
In full display mode the device names below the pictures are not always displayed. I also get some red blinking names.
I found the bugs:
near the code:

Code: Select all

if ($row6["thold_fail_count"] >= $row6["thold_fail_trigger"]) {
          $td=2;
If you use the thold-default values the fail_trigger is NULL, so always an error is displayed.

The disapearing names:
The code

Code: Select all

f ($td == 1) {
  ?>
  <DIV ID="calque1" STYLE="visibility:visible"><font color="yellow"><b><?php print $msg; ?></div>
  <?php
}

if ($td == 2) {
  ?>
  <DIV ID="calque2" STYLE="visibility:visible"><font color="red"><b><?php print $msg; ?></div>
  <?php
is the correct one: the style must not be hidden, it must be visible!


Greetings
Torsten
Ok the above fix within thold helps out while in list view... But I still have names that do not appear in the other 2 views. Also I still see some random flashing and different colors on some of the names that is kind of annoying.

Other than the above issues I love this plugin. I was never able to get thold to send out the host down alerts so having this plugin finally fills my missing feature within cacti.
-Josh
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »


Ok the above fix within thold helps out while in list view... But I still have names that do not appear in the other 2 views. Also I still see some random flashing and different colors on some of the names that is kind of annoying.

Other than the above issues I love this plugin. I was never able to get thold to send out the host down alerts so having this plugin finally fills my missing feature within cacti.
-Josh
Hi,

this code is found 3 times in the manage plugin. once for every view mode: so you must check the other lines.
Torsten
joshm
Cacti User
Posts: 82
Joined: Mon Oct 03, 2005 1:34 pm
Location: STL

Post by joshm »

Sweet that did it, now I still have some of the flashing and different colors though.... Any fixes for that?
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests