Network Management Integration Plugin ( v0.3.9a Build 129 )

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

Ha, I forgot about that. Going to change that in the nmidPhpip setup to take care of prepending the $config['url_path'] to the string.

Thanks for pointing this out

( I've got $config['url_path'] set to "/" )
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

I changed the setup.php for nmidPhpip to the following, which should work for your installation, too ( function nmidPhpip_config_arrays ):

Code: Select all

    $strippedUrlPath = preg_replace("/^\//","",$config['url_path'] );

    $temp = array(
        $strippedUrlPath . "plugins/nmidPhpip/display.php" => array(
            $strippedUrlPath . "plugins/nmidPhpip/display.php" => "NMID phpIP",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_add.php" => "CIDR Add",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_remove.php" => "CIDR Remove",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_desc.php" => "CIDR Description",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_add.php" => "Prefix Add",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_remove.php" => "Prefix Remove",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_desc.php" => "Prefix Description",
            $strippedUrlPath . "plugins/nmidPhpip/search.php" => "Search",
            $strippedUrlPath . "plugins/nmidPhpip/subnetSummary.php" => "Subnet Summary",
            ),
    );
User avatar
sizulku
Cacti User
Posts: 110
Joined: Mon Nov 04, 2002 9:15 am
Location: ACEH
Contact:

Post by sizulku »

Great plugin! And work very well on my system. Thanks Phalek!
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

phalek wrote:I changed the setup.php for nmidPhpip to the following, which should work for your installation, too ( function nmidPhpip_config_arrays ):

Code: Select all

    $strippedUrlPath = preg_replace("/^\//","",$config['url_path'] );

    $temp = array(
        $strippedUrlPath . "plugins/nmidPhpip/display.php" => array(
            $strippedUrlPath . "plugins/nmidPhpip/display.php" => "NMID phpIP",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_add.php" => "CIDR Add",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_remove.php" => "CIDR Remove",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_desc.php" => "CIDR Description",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_add.php" => "Prefix Add",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_remove.php" => "Prefix Remove",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_desc.php" => "Prefix Description",
            $strippedUrlPath . "plugins/nmidPhpip/search.php" => "Search",
            $strippedUrlPath . "plugins/nmidPhpip/subnetSummary.php" => "Subnet Summary",
            ),
    );
Not work.
When try open menu "NMID phpIP" I get error:
"The requested URL /cacti/cacti/plugins/nmidPhpip/display.php was not found on this server."
And not work other sub-menu (Graph Management), so I stay only 1 change in /lib/html.php:

Code: Select all

$current_url = preg_replace("/(^\/(cacti\/)?)()/","$3",$_SERVER["PHP_SELF"]); 
Whether you accept Feature Requests for this plug-in?
It will be great to add Tree in PHPip to look like in attach.
Attachments
fr_phpip.jpg
fr_phpip.jpg (509 KiB) Viewed 11468 times
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

gthe wrote:

Code: Select all

$current_url = preg_replace("/(^\/(cacti\/)?)()/","$3",$_SERVER["PHP_SELF"]); 
Hm, can this be made more generic, based on the url_path ?
Whether you accept Feature Requests for this plug-in?
It will be great to add Tree in PHPip to look like in attach.
Sure I can, just need to look into this. Used part of this stuff already for the main NMID component
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

phalek wrote:
gthe wrote:

Code: Select all

$current_url = preg_replace("/(^\/(cacti\/)?)()/","$3",$_SERVER["PHP_SELF"]); 
Hm, can this be made more generic, based on the url_path ?
My hostinfo:
Cacti Version - 0.8.7b
Plugin Architecture - 2.0
Poller Type - Cactid v
Server Info - Linux 2.6.18-53.1.14.el5.centos.plus
Web Server - Apache/2.2.3 (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, dbg, bcmath, gd, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, snmp
MySQL - 5.0.22-log
RRDTool - 1.2.23
SNMP - 5.3.1
Plugins
  • Update Checker (update - v0.4)
    Network Tools (tools - v0.2)
    Host Info (hostinfo - v0.2)
    Device Tracking (mactrack - v1.1)
    impblinding (impblinding - v0.0.26b)
    Global Plugin Settings (settings - v0.3)
    Thresholds (thold - v0.3.9)
    snmptt (snmptt - v0.0.04b)
    Real-time statistics (zond - v0.34)
    SuperLinks (superlinks - v0.72)
    NMID phpIP Plugin (nmidPhpip - v0.3.8a)
phalek wrote: ( I've got $config['url_path'] set to "/" )
There can be a problem, because at me it is not present.
Also, I check Plugin Architecture v2.0 for Cacti v0.8.7b from cactiusers.org and cacti-0.8.7b.tar.gz. from this site and both archives don't have that string not in config.php not global.php
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

It's in include/plugins.php.

Look at http://cactiusers.org/forums/topic1362.html for some details. Maybe this is the problem then ?
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

phalek wrote:It's in include/plugins.php.

Look at http://cactiusers.org/forums/topic1362.html for some details. Maybe this is the problem then ?
But I don't have any problem with standart plugins.php, without that line:

Code: Select all

$config['url_path'] set to "/cacti/"
because:

Code: Select all

mysql> use cacti;
Database changed
mysql> SELECT value FROM settings WHERE name = 'url_path';
+---------+
| value   |
+---------+
| /cacti/ |
+---------+
1 row in set (0.00 sec)

For testing purpose I change:
in include/plugins.php

Code: Select all

// if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['REMOTE_ADDR'])) {
//         $config['url_path'] = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']), strlen(__FILE__) - strlen($_SERVER['DOCUMENT_ROOT']) - strlen('include/plugins.php'));
//         db_execute("REPLACE INTO settings (name, value) VALUES ('url_path', '" . $config['url_path'] . "')");
// } else {
//         $config['url_path'] = db_fetch_cell("SELECT value FROM settings WHERE name = 'url_path'");
// }
$config['url_path'] = '/cacti/';
in setup.php for nmidPhpip

Code: Select all

$strippedUrlPath = preg_replace("/^\//","",$config['url_path'] );

    $temp = array(
        $strippedUrlPath . "plugins/nmidPhpip/display.php" => array(
            $strippedUrlPath . "plugins/nmidPhpip/display.php" => "NMID phpIP",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_add.php" => "CIDR Add",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_remove.php" => "CIDR Remove",
            $strippedUrlPath . "plugins/nmidPhpip/cidr_desc.php" => "CIDR Description",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_add.php" => "Prefix Add",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_remove.php" => "Prefix Remove",
            $strippedUrlPath . "plugins/nmidPhpip/prefix_desc.php" => "Prefix Description",
            $strippedUrlPath . "plugins/nmidPhpip/search.php" => "Search",
            $strippedUrlPath . "plugins/nmidPhpip/subnetSummary.php" => "Subnet Summary",
            ),
    ); 
in html.php

Code: Select all

$current_url = preg_replace("/^\//","",$_SERVER["PHP_SELF"]);
Rezult:
no cacti sub-menu. When try accessing phpip page got error:

Code: Select all

The requested URL /cacti/cacti/plugins/nmidPhpip/display.php was not found on this server.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

Hi gthe

I'm going to setup a separate cacti installation where I'm going to test and hopefully fix this problem in a generic way. Anyway thanks for pointing this error out.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

A short Update to the Cacti-Tree feature request: It is working and will be included in the next release.

Under each tree the used CIDRs will be shown, a double click on one will select it for display.
Attachments
nmid_phpIP_cactiTree.jpg
nmid_phpIP_cactiTree.jpg (37.3 KiB) Viewed 11384 times
User avatar
sizulku
Cacti User
Posts: 110
Joined: Mon Nov 04, 2002 9:15 am
Location: ACEH
Contact:

feature request

Post by sizulku »

Hi Thomas,

I would like to ask the feature for NimdTaskManager as folow;

1. Status of the task (finished, canceled, postponed, etc)
2. Ability to move task to other day, month or year.
3. Ability to view task any date, month or year.

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

Post by mcutting »

Hi. I tried to get nmsphpip working, but failed...!

I can't get the sub menus, and /cacti is also being added into the path when attempting to click the menu link once the plugin is installed.

Has anyone managed to get this working properly, as I'd love to be able to manage IP Addresses inside of CACTI !

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

did you add the code to the html.php file ?
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Hi Phalek,

Yes, but to be honest, I wasn't sure exactly what or where to add this, as there seem to be conflicting posts.

Also, has the array code been added into setup.php already, or do I need to do this also ?

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

array ? what array ??

Nevertheless, replace your html.lib file with the attached one (make sure to backup yours first).

It should work then (hopefully :-)
Attachments
html.tar.gz
(6.91 KiB) Downloaded 463 times
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests