Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Nagios Plugin for Cacti 2.0.0b (build 166) released
Goto page Previous  1, 2, 3 ... 9, 10, 11 ... 13, 14, 15  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General
Author Message
divagater
Cacti User


Joined: 17 Nov 2004
Posts: 101
Location: Chapel Hill, NC.

PostPosted: Wed Apr 23, 2008 7:16 pm    Post subject: Reply with quote

amaena wrote:
Is there any additional documentation available for setting up the performance graphs for nagios services in cacti using npc?

I followed the steps from page 8 of the forum by clicking on services, and then service detail and map graph, however the only graphs available are localhost ones and I am wondering what needs to be done from the cacti side.

I see the option on create new host for mapping a hostname to a nagios hostname but would like a bit more guidance. Perhaps something like setting up a performance graph for using the ping results from nagios?

Thanks !


Hi amaena. I realise the documentation is slim and I will try to clear this up for you. 1st, your post touches on 2 different pieces of NPC. What you are asking is how to create a graph from the performance data returned by a nagios check plugin. The 'Map Graph' button that you refer to is used to map/link an exisitng Cacti graph to a Nagios host or service.

NPC does not automate the whole process of creating graphs from performance data. Instead it does just the 1st step for you which is creating a data input method. The data input method that gets created will be based on the performance data being returned by Nagios and calls the script plugins/npc/perfdata.php to poll the perfdata from the database.

To create the data input method open up the service detail by double clicking a service from the services list. If the service has performance data available you will see a 'Data Input Method' button on the top toolbar of the 'Service State Information' tab (see screenshot). If there is not any performance data then you won't see the button.

Click the 'Data Input Method' button and confirm. The data input method will be named 'NPC - Perfdata - <host>: <service>'. See the second screenshot.

Now you need to manually create a data template using the data input method you just created followed by a graph template etc. as normal. Once you have a graph you can go back to the appropriate service and use the map graph button to map the graph you created to the service it belongs too.

Hope this helps,
Billy



data_input.png
 Description:
Create data input method
 Filesize:  43.19 KB
 Viewed:  2657 Time(s)

data_input.png



data_input2.png
 Description:
A data input method created by NPC
 Filesize:  15.07 KB
 Viewed:  2657 Time(s)

data_input2.png


Back to top
Heiko



Joined: 23 Apr 2008
Posts: 25

PostPosted: Thu Apr 24, 2008 9:41 am    Post subject: Reply with quote

divagater wrote:
Heiko wrote:
How can i get npc to show up in cacti?


Heiko, you need to have plugin architecture 2.0 or higher. 2.1 is the latest. After the plugin architecture is installed go to Console -> User Management. Select your admin user and check 'Plugin Management'. This will enable plugin management for that user.

Then follow the steps in the quickstart guide for installing NPC.

~Billy

Hello,
i have the latest package installed, could this be some bad permissions?
Back to top
marsiou



Joined: 14 Apr 2008
Posts: 7

PostPosted: Thu Apr 24, 2008 10:05 am    Post subject: Reply with quote

hello, i am on fedora,
I install nagios 3.0.1, cacti 0.87b, Ndoutils, Plugin Architecture 2.1.

I can't see NPC in my browser.

I follow the documentation : http://trac2.assembla.com/npc/wiki/QuickStartGuide

I can see "Plugin Management" and when i went to "user management" to active it, i didn't find....

How i can solve this problem ?

Thanks
Back to top
divagater
Cacti User


Joined: 17 Nov 2004
Posts: 101
Location: Chapel Hill, NC.

PostPosted: Thu Apr 24, 2008 10:48 am    Post subject: Reply with quote

marsiou wrote:

I can see "Plugin Management" and when i went to "user management" to active it, i didn't find....


If you can see "Plugin Management" then click it. On the plugin management screen click the 'Uninstalled' tab. You should see NPC listed with various other attributes as well as some links to install, uninstall, enable etc. You need to click the 'Install' link to install NPC.

If you do not see NPC listed then is the latest version of NPC in the plugins directory? Do you have the same plugin under the plugins directory but with different name like:

Code:

someplugin
someplugin-01


This will break the plugin manager. A plugin can only be in the plugins directory 1 time.

~Billy
Back to top
marsiou



Joined: 14 Apr 2008
Posts: 7

PostPosted: Thu Apr 24, 2008 10:50 am    Post subject: Reply with quote

I found , I forgot to update the database cacti with the pa.sql.

Thanks you
Back to top
Heiko



Joined: 23 Apr 2008
Posts: 25

PostPosted: Thu Apr 24, 2008 11:19 am    Post subject: Reply with quote

marsiou wrote:
I found , I forgot to update the database cacti with the pa.sql.

Thanks you


ahh, that hurts.
now i have a npc tab.

But it doesnt say anything about that in this doc http://cactiusers.org/wiki/PluginArchitectureInstall
And i used the zip files which unpack some stuff in the pwd, which i miss to look at.
Back to top
ralf.kirmis



Joined: 03 Sep 2007
Posts: 1

PostPosted: Tue Apr 29, 2008 8:05 am    Post subject: Reply with quote

Hi,

is it possible to change the table names to say ndo_* instead of
npc_* ?

I've running an ndo installation with the nagvis addon and don't
like to change the complete database layout.

thx,
Ralf
Back to top
chrisgapske
Cacti User


Joined: 22 May 2007
Posts: 266
Location: Padacuh, Ky-Alpena, MI-Gulf Shores,AL

PostPosted: Tue Apr 29, 2008 8:08 am    Post subject: Reply with quote

you might be able to link the table .. but I would not think changing the table name would be easy you would have to maintain any updates.
Back to top
divagater
Cacti User


Joined: 17 Nov 2004
Posts: 101
Location: Chapel Hill, NC.

PostPosted: Tue Apr 29, 2008 9:51 am    Post subject: Reply with quote

ralf.kirmis wrote:
Hi,

is it possible to change the table names to say ndo_* instead of
npc_* ?

I've running an ndo installation with the nagvis addon and don't
like to change the complete database layout.

thx,
Ralf


Changing the table names would be complicated. A better approach for you would be to setup another instance of ndo. A new ndomod.cfg like ndomod_npc.cfg and ndo2db_npc.cfg. Add another broker entry to your nagios.cfg and fire up another instance of the ndo2db daemon pointing to the new config. Now all your databases get populated and no code changes needed.

Even with a large nagios install the resources used to populate these databases should be small.

~Billy
Back to top
gimpel



Joined: 08 Apr 2008
Posts: 5

PostPosted: Tue Apr 29, 2008 10:03 am    Post subject: Reply with quote

Hrm, got a bit time to play with graphs again.
I seem to have trouble with parsing the output of perfdata.php or similar..

What I did was

    2) select some service (load average in this case) and create the data input method using NPC



    5) Created a data source



    7) added that to the tree


Now, in the logs I get
Quote:
04/29/2008 04:50:02 PM - CMDPHP: Poller[0] Host[2] DS[8] WARNING: Result from CMD not valid. Partial Result: load1:0.690 load5:0
04/29/2008 04:50:03 PM - SYSTEM STATS: Time:1.1767 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:6 RRDsProcessed:6

Executing the script behind the data input method manually:
Code:
# php plugins/npc/perfdata.php --type=service --id=84
load1:0.500  load5:0.690  load15:0.710

..and the graph is empty of course.

Bug? Or error on my side?
Back to top
gimpel



Joined: 08 Apr 2008
Posts: 5

PostPosted: Mon May 05, 2008 10:08 am    Post subject: Reply with quote

Got it!

The perfdata.php spit out one space too much after the values.

So I edited it from line 65 to look like:
Code:
        $output .= preg_replace("/=/", ':', $perf);
    }
}

echo $output;


Now it passes the validate_result function from functions.php, which tests if number of spaces + 1 equals the number of delimiters.

Now, in the shell it looks like:
Code:
phmon01:/usr/share/cacti # php plugins/npc/perfdata.php --type=service --id=84
load1:0.090 load5:0.370 load15:0.440phmon01:/usr/share/cacti #

Only one space between values, and no newline.

Additionally I edited cmd.php, there is a test if strlen > 20; then strout = 20. That sounds like plain nonsense. I made that if strlen < 20, then set it to at least 20.
From line 367 on:
Code:
                                if (!validate_result($output)) {
                                        if (strlen($output) < 20) {
                                                $strout = 20;
                                        } else {
                                                $strout = strlen($output);
                                        }


Captain, we got graphs! Yay!
Back to top
padawan



Joined: 30 Nov 2007
Posts: 25

PostPosted: Fri May 09, 2008 3:47 am    Post subject: Reply with quote

hello everyone,

I still have a problem with graph on npc
I got a list of graph but when I selected one nothing happen



npcgraph.JPG
 Description:
 Filesize:  102.73 KB
 Viewed:  2143 Time(s)

npcgraph.JPG


Back to top
homa



Joined: 14 Aug 2003
Posts: 3

PostPosted: Wed May 14, 2008 9:34 am    Post subject: No maps Reply with quote

Hello !

Hi i have perhaps the same problem. I can map the graph but I can't see any map.

Thanks
Back to top
stevetuk31



Joined: 16 Jul 2007
Posts: 3

PostPosted: Wed May 21, 2008 7:10 am    Post subject: This is great!! Reply with quote

Just like to say thanks.

Installation instructions are clear.
Functionality is great.

Bloody brilliant!!
Back to top
endlessocean



Joined: 22 May 2008
Posts: 1

PostPosted: Thu May 22, 2008 4:23 am    Post subject: Fatal Error Reply with quote

Hi, I got a problem here, i can see the npc tab.
but when i click it, a fata error showed like this:
Fatal error: Class 'BaseNpcFlappinghistory' not found in /usr/share/cacti/plugins/npc/models/NpcFlappinghistory.php on line 6

any idea about this?
thanks a lot.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General All times are GMT - 5 Hours
Goto page Previous  1, 2, 3 ... 9, 10, 11 ... 13, 14, 15  Next
Page 10 of 15

 



Powered by phpBB © 2001, 2005 phpBB Group