Cacti and Nagios integration dashboard

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

wazoqaz
Posts: 15
Joined: Wed May 24, 2006 9:40 am
Location: md, us
Contact:

Post by wazoqaz »

I too am trying to install. I installed all the pear modules (I had most of them anyway), but I had problems becuase my php installation does not have --with-snmp. It is the same host as my Cacti server so it appears that Cacti does not requeire php with snmp support.

Is there anyway to get around the snmp requirement without a recompile of php?
TaTo
Posts: 1
Joined: Wed Nov 29, 2006 6:44 pm
Location: Argentina, Buenos Aires

It's perfect

Post by TaTo »

Dear perldork... your work is a lot for me!!

I've some errors but everything work ok.

PHP Warning: imagettfbbox() [<a href='function.imagettfbbox'>function.imagettfbbox</a>]: Could not find/open font in /usr/share/pear/Image/Canvas/GD.php on line 1308

I solved this problem copying the arial.ttf to cacinda directory where index.php resides.

But i'm in trouble with this:

PHP Warning: Division by zero in /html/cacinda/inc/Windows_MS_SNMP.class.php on line 82

And not getting any RAM available graph

Example
Image

and as you can see cannot see any nagios status info:

Error retrieving Nagios content from http://localhost/nagios/cgi-bin/status.cgi

Is there any way to solve this ??

thanks for all your work!!

Sergio
perldork
Cacti User
Posts: 69
Joined: Fri Nov 05, 2004 9:06 am
Contact:

Re: MOre feedback

Post by perldork »

Hi Scott,
slander wrote:Max,
But - another problem is that the hostname being passed into the function get_nagios_info is the Cacti long name, not the host name that nagios (or cacti) would use. For instance, it is passing this name: "XXXX Portland UU GW" while it knows nagios knows it as this: xxxx-uu-gw. The first two lines of the dashboard are these same two names, so, I know it has them at this point, just the wrong one is being passed in from the template.
Scott
There is a configuration field that lets you specify a regular expression to use to convert your Cacti names to Nagios names, let me know if you have problems using that. From config.php

// What to match/replace in order to make host name Nagios-friendly
$NAGIOS_HOST_MATCH = '';
$NAGIOS_HOST_REPLACE = '';

From line 139 of functions.php:

Code: Select all

$nagios_host = preg_replace(Configuration::nagios_host_match(),
                                Configuration::nagios_host_replace(),
                                 $host);
So if you use a regular expression with capturing parens you can convert the host names from your Cacti format to Nagios format :).

Hope this helps and thank you for all the feedback and comments!
[url=http://www.semintelligent.com/blog]Max Schubert a.k.a perldork[/url]
[url=http://wwd-hosting.net/ensim/]Ensim scripts and utilities (GPL)[/url] - [url=http://nmap-scanner.sf.net]Perform nmap scans with perl (GPL)[/url]
[url=http://lmf.sf.net]Perl-based log monitoring framework(GPL)[/url]
perldork
Cacti User
Posts: 69
Joined: Fri Nov 05, 2004 9:06 am
Contact:

Post by perldork »

Hi,

I will be converting this project to be a Cacti plugin, so at that point I will change to use the Cacti functions for retrieving data over SNMP.

I will also add code to detect if SNMP functionality is present so that if there is no SNMP available the index.php controller will not try to retrieve the host description using SNMP as part of the host -> template match check.

Thanks for your input.

- Max
wazoqaz wrote:I too am trying to install. I installed all the pear modules (I had most of them anyway), but I had problems becuase my php installation does not have --with-snmp. It is the same host as my Cacti server so it appears that Cacti does not requeire php with snmp support.

Is there anyway to get around the snmp requirement without a recompile of php?
[url=http://www.semintelligent.com/blog]Max Schubert a.k.a perldork[/url]
[url=http://wwd-hosting.net/ensim/]Ensim scripts and utilities (GPL)[/url] - [url=http://nmap-scanner.sf.net]Perform nmap scans with perl (GPL)[/url]
[url=http://lmf.sf.net]Perl-based log monitoring framework(GPL)[/url]
perldork
Cacti User
Posts: 69
Joined: Fri Nov 05, 2004 9:06 am
Contact:

Re: It's perfect

Post by perldork »

Hi Sergio,
TaTo wrote:Dear perldork... your work is a lot for me!!

But i'm in trouble with this:

PHP Warning: Division by zero in /html/cacinda/inc/Windows_MS_SNMP.class.php on line 82

And not getting any RAM available graph
What version of Windows are you using? Are you using the native SNMP service or a third party agent?
and as you can see cannot see any nagios status info:

Error retrieving Nagios content from http://localhost/nagios/cgi-bin/status.cgi

Is there any way to solve this ??
Where is Nagios installed on your network? Is it on the same host as Cacti? Do you have Apache (or whatever web server you are using) set up so that Nagios information can be retrieved without a username/password for that host?

Regards,
Max
[url=http://www.semintelligent.com/blog]Max Schubert a.k.a perldork[/url]
[url=http://wwd-hosting.net/ensim/]Ensim scripts and utilities (GPL)[/url] - [url=http://nmap-scanner.sf.net]Perform nmap scans with perl (GPL)[/url]
[url=http://lmf.sf.net]Perl-based log monitoring framework(GPL)[/url]
Smistir
Posts: 15
Joined: Wed Nov 08, 2006 9:34 am
Location: Florida

Some minor questions

Post by Smistir »

Max,

I apologize for coming across as a newb. But I was curious.. My client requires that SNMP NOT be used. Is it a safe assumption that their requirement will greatly diminish the value of Cacinda?

It has been my understanding that most of Cacti uses SNMP. To date, I haven't been able to do much monitoring of my intended systems.

It has been discussed and decided in my group that the type of tool that you are building is exactly what we want and need.. but I am not sure about its functionality without SNMP.
perldork
Cacti User
Posts: 69
Joined: Fri Nov 05, 2004 9:06 am
Contact:

Re: Some minor questions

Post by perldork »

Hi Smistir,

I have made several non-SNMP dashboards with this simple framework, yes, it can be used for that purpose, you will probably have to remove some code that relies on SNMP for this to work with the current version, a future version of Cacinda will have wrapper code around the SNMP functions so that the SNMP functions will only be used if they are present.

Regards,
Max
Smistir wrote:Max,

I apologize for coming across as a newb. But I was curious.. My client requires that SNMP NOT be used. Is it a safe assumption that their requirement will greatly diminish the value of Cacinda?

It has been my understanding that most of Cacti uses SNMP. To date, I haven't been able to do much monitoring of my intended systems.

It has been discussed and decided in my group that the type of tool that you are building is exactly what we want and need.. but I am not sure about its functionality without SNMP.
[url=http://www.semintelligent.com/blog]Max Schubert a.k.a perldork[/url]
[url=http://wwd-hosting.net/ensim/]Ensim scripts and utilities (GPL)[/url] - [url=http://nmap-scanner.sf.net]Perform nmap scans with perl (GPL)[/url]
[url=http://lmf.sf.net]Perl-based log monitoring framework(GPL)[/url]
high.pointe
Posts: 3
Joined: Fri Oct 13, 2006 3:20 pm

No device class matches found for........

Post by high.pointe »

No device class matches found for........

PD,

Regarding the above mentioned error.....

You referenced some information on fixing this earlier in the thread....

*************
config.php

// What to match/replace in order to make host name Nagios-friendly
$NAGIOS_HOST_MATCH = '';
$NAGIOS_HOST_REPLACE = '';

From line 139 of functions.php:

Code:

$nagios_host = preg_replace(Configuration::nagios_host_match(),
Configuration::nagios_host_replace(),
$host);
**************

But I'm still a bit of a newb when it comes to php so I haven't been able to figure out exactly the edits to make in order to resolve the error.

Any insight of any kind would be appreciated.

Thanks in advance.
perldork
Cacti User
Posts: 69
Joined: Fri Nov 05, 2004 9:06 am
Contact:

Re: No device class matches found for........

Post by perldork »

high.pointe wrote:No device class matches found
But I'm still a bit of a newb when it comes to php so I haven't been able to figure out exactly the edits to make in order to resolve the error.

Any insight of any kind would be appreciated.

Thanks in advance.


Based on what you had initially posted:

The device name in Cacti is "XXXX Portland UU GW" while it knows nagios knows it as this: xxxx-uu-gw.

Code: Select all

$NAGIOS_HOST_MATCH = '/(\S+)\s+\S+\s+(.*)/e';
$NAGIOS_HOST_REPLACE = "str_replace(' ', '-', strtolower('\${1}-\${2}'))";
This works for me to convert

XXXX NameofPlace UU Name to

xxxx-uu-name
[url=http://www.semintelligent.com/blog]Max Schubert a.k.a perldork[/url]
[url=http://wwd-hosting.net/ensim/]Ensim scripts and utilities (GPL)[/url] - [url=http://nmap-scanner.sf.net]Perform nmap scans with perl (GPL)[/url]
[url=http://lmf.sf.net]Perl-based log monitoring framework(GPL)[/url]
eohimor
Posts: 1
Joined: Mon Jan 08, 2007 9:32 am

Error when Installing Browsing to Cacinda

Post by eohimor »

Hello,

I am very much interested in this plugin.I have installed the Cacinda on my Cacti server which is also where my Nagios is installed.Whenever I try to open the Cacinda webpage.I get the error:'DB Error: connect failed.
Can anyone help?
My /var/www/html/cacti/include/config.php has the following :
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
#$database_default = "cacti";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
#$database_password = "cactiuser";
$database_password = "cactipw";
$database_port = "3306";

$plugins = array();
$plugins[] = 'thold';
$plugins[] = 'monitor';


while my /var/www/html/cacinda-0.1-alpha directory has the following

$SNMP_PORT = 161;

// Hosts per row for all.php
$HOSTS_PER_ROW = 4;

$ALL_HOSTS_WHERE = "1 = 1";

$CACTI_USERNAME = 'cactiuser';
$CACTI_PASSWORD = 'cactipw';
$CACTI_HOST = 'localhost';
$CACTI_SOCKET = false;
$CACTI_DATABASE = 'cactidb';
$CACTI_URL = '/cacti';


Any help will be greatly appreciated.Thanks[/b]
knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

Post by knobdy »

How much longer for the plugin? Any updates?
perldork
Cacti User
Posts: 69
Joined: Fri Nov 05, 2004 9:06 am
Contact:

Re: Error when Installing Browsing to Cacinda

Post by perldork »

Hi,

What happens if you set CACTI_SOCKET to true?

- Max
eohimor wrote:Hello,

I am very much interested in this plugin.I have installed the Cacinda on my Cacti server which is also where my Nagios is installed.Whenever I try to open the Cacinda webpage.I get the error:'DB Error: connect failed.
Can anyone help?
My /var/www/html/cacti/include/config.php has the following :
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
#$database_default = "cacti";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
#$database_password = "cactiuser";
$database_password = "cactipw";
$database_port = "3306";

$plugins = array();
$plugins[] = 'thold';
$plugins[] = 'monitor';


while my /var/www/html/cacinda-0.1-alpha directory has the following

$SNMP_PORT = 161;

// Hosts per row for all.php
$HOSTS_PER_ROW = 4;

$ALL_HOSTS_WHERE = "1 = 1";

$CACTI_USERNAME = 'cactiuser';
$CACTI_PASSWORD = 'cactipw';
$CACTI_HOST = 'localhost';
$CACTI_SOCKET = false;
$CACTI_DATABASE = 'cactidb';
$CACTI_URL = '/cacti';


Any help will be greatly appreciated.Thanks[/b]
[url=http://www.semintelligent.com/blog]Max Schubert a.k.a perldork[/url]
[url=http://wwd-hosting.net/ensim/]Ensim scripts and utilities (GPL)[/url] - [url=http://nmap-scanner.sf.net]Perform nmap scans with perl (GPL)[/url]
[url=http://lmf.sf.net]Perl-based log monitoring framework(GPL)[/url]
perldork
Cacti User
Posts: 69
Joined: Fri Nov 05, 2004 9:06 am
Contact:

Post by perldork »

Hi knobdy,

Could be a few months still, sorry. I have this project on sf.net now, if people are interested in working with me on this, please contact me via sf.net :).

http://cacinda.sf.net/

- Max
knobdy wrote:How much longer for the plugin? Any updates?
[url=http://www.semintelligent.com/blog]Max Schubert a.k.a perldork[/url]
[url=http://wwd-hosting.net/ensim/]Ensim scripts and utilities (GPL)[/url] - [url=http://nmap-scanner.sf.net]Perform nmap scans with perl (GPL)[/url]
[url=http://lmf.sf.net]Perl-based log monitoring framework(GPL)[/url]
MorbidDK
Posts: 11
Joined: Thu Apr 28, 2005 8:11 am

Post by MorbidDK »

Appears that I have the same error mentioned above.

No device class matches found for localhost (localhost)

From everything I can see Nagios host (localhost) matches the Cacti host (localhost), I just can't seem to get past this.
perldork
Cacti User
Posts: 69
Joined: Fri Nov 05, 2004 9:06 am
Contact:

Post by perldork »

What kind of a host is your localhost? :)
MorbidDK wrote:Appears that I have the same error mentioned above.

No device class matches found for localhost (localhost)

From everything I can see Nagios host (localhost) matches the Cacti host (localhost), I just can't seem to get past this.
[url=http://www.semintelligent.com/blog]Max Schubert a.k.a perldork[/url]
[url=http://wwd-hosting.net/ensim/]Ensim scripts and utilities (GPL)[/url] - [url=http://nmap-scanner.sf.net]Perform nmap scans with perl (GPL)[/url]
[url=http://lmf.sf.net]Perl-based log monitoring framework(GPL)[/url]
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests