Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Fri Aug 29, 2014 11:03 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 62 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: dhcpd-snmp
PostPosted: Tue Jun 20, 2006 9:22 am 
Offline

Joined: Tue Jun 20, 2006 9:04 am
Posts: 17
Hi all,

I've created a template to monitor dhcp usage using the dhcpd-snmp you can find at:

http://www.net-track.ch/opensource/dhcpd-snmp/

The perlscript creates a configfile for dhcpd-snmp from dhcpd.conf.

Please see if you like it.

CdG


Attachments:
dhcpd-snmp.zip [4.3 KiB]
Downloaded 4021 times
Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 10:22 am 
Offline

Joined: Tue Jun 20, 2006 9:04 am
Posts: 17
<Sigh>

of course I forgot to include the snmp_queries xml-file.


Attachments:
dhcpd-snmp.xml [1.76 KiB]
Downloaded 3366 times
Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 10:04 am 
Offline

Joined: Thu Aug 03, 2006 9:31 am
Posts: 1
I came a cross this post and was pleased to see some one made a nice .xml file for using the package dhcp-snmp. I haven't found anything else that could help me.



I downloaded the .xml file and tried importing it, cacti didn't show me the messages I was hoping to see "adding template ...", you probably know waht I mean.

I'm using the latest cact at the moment, which is 0.8.6h.

After some experimenting with the .xml file I finally noticed it's not a .xml template for a graph or data objects. It actually is a .xml "data query template" file. Which I placed at the <path_cacti>/resource/snmp_queries/ location and added it as a query file to cacti.

As you might have noticed I'm "new" to cacti, because I recently installed it and still getting new ideas to put into cacti.

I've been toying around with all kinds of different ways to get the info I wanted out of SNMP and finally managed to generate a nice graph.

I just finished the template and haven't had much testing yet.. The graph is included at this post.



I also included my graph template, so people who're interessted on this topic can try it out themselves. Maybe more experianced people could have a look at this and comment to this?

Before I forget: Tnx CdG for posting this .xml file, it did help me alot to go
investigate and understand cacti a bit more :)

,
DW


Attachments:
File comment: My dhcp-snmp graph
graph_image.php.png
graph_image.php.png [ 23.42 KiB | Viewed 53561 times ]
File comment: My first cacti template :)
cacti_graph_template_dhcp_snmp.xml [25.45 KiB]
Downloaded 2090 times
Top
 Profile  
 
 Post subject: Modified Data Template
PostPosted: Mon Aug 07, 2006 4:57 am 
Offline

Joined: Mon Aug 07, 2006 4:51 am
Posts: 1
Hi!

I checked out your template and modified it, so that all data sources are put together in one template. IMHO it is a little bit more handy.

Now you can create more pools in dhcpd-snmp.conf and when creating graphs, a list of available pools is autocreated by get-snmp-data (indexed).

Fhuber


Attachments:
File comment: Modified data template (all data sources in one template)
cacti_graph_template_dhcp_statistics_snmp.xml [19.6 KiB]
Downloaded 2391 times
Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 10:04 am 
Offline
Cacti Pro User
User avatar

Joined: Thu Nov 21, 2002 8:55 am
Posts: 703
Location: Austin, TX
Ok, I am trying this out.

I have the snmp part working fine, but I am a little confused on which xml file goes where...

Does the xml file inlcluded in the zip go under <cacti>/resource/snmp_queries ? that is where I put it.
and which of the posted xml files needs to be imported? I imported the last one for multple scopes without any problems.
Also, do I need to spec any custom data when creating the graph (OID, etc...)
So far this is what I get with graph debugging on
Code:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="dhcp2 - DHCP |query_dhcpSnmpPoolDescription| Statistics" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="# leases" \
--slope-mode \
DEF:a="/var/www/html/rra/dhcp2_poolactive_1169.rrd":PoolActive:AVERAGE \
DEF:b="/var/www/html/rra/dhcp2_poolactive_1169.rrd":PoolAvailable:AVERAGE \
DEF:c="/var/www/html/rra/dhcp2_poolactive_1169.rrd":PoolExpire:AVERAGE \
DEF:d="/var/www/html/rra/dhcp2_poolactive_1169.rrd":PoolSize:AVERAGE \
LINE2:a#4444FF:"Active leases"  \
GPRINT:a:LAST:"   Current\:%8.2lf%s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf%s\n"  \
LINE2:b#00CF00:"Available leases"  \
GPRINT:b:LAST:"Current\:%8.2lf%s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf%s\n"  \
LINE2:c#F51D30:"Expired leases"  \
GPRINT:c:LAST:"  Current\:%8.2lf%s"  \
GPRINT:c:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:c:MAX:"Maximum\:%8.2lf%s\n"  \
LINE2:d#CCBB00:"Pool size"  \
GPRINT:d:LAST:"       Current\:%8.2lf%s"  \
GPRINT:d:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:d:MAX:"Maximum\:%8.2lf%s\n"

RRDTool Says:

ERROR: opening '/var/www/html/rra/dhcp2_poolactive_1169.rrd': No such file or directory


No entries in cacti.log, but I need to bump up the logging level and check again

This is a really awesome script and we could definately make use of it, but not quite there yet..

thanks for your help

_________________
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 11, 2006 5:40 pm 
Offline

Joined: Wed Apr 12, 2006 12:19 pm
Posts: 1
Same problem here, I put the first .xml in the path dw specified but can't import the template egarnel or fhuber made, but thank you for the files, nice work.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 15, 2006 4:33 am 
Offline

Joined: Thu Dec 08, 2005 4:29 am
Posts: 6
i'm having problems installing the dhcpd-snmp script.
when i test it :

[root@devbox]# dhcpd-snmp dhcpd-snmp.conf
PING
PONG
get
.1.3.6.1.4.1.21695.1.2.1
NONE

from the readme it says i should be getting three lines: the OID, ``integer'', and the number of configured pools.

thanks.


Top
 Profile  
 
 Post subject: About Custom datas fields ...
PostPosted: Sat Oct 14, 2006 10:20 am 
Offline

Joined: Sat Oct 14, 2006 10:10 am
Posts: 2
Hello,

Does anyone know which values I must put in 3 custom fields :

Index Type
Index Value
Output Type ID

Seems that without this values the template can't works ...

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 5:45 am 
Offline

Joined: Tue Jun 20, 2006 9:04 am
Posts: 17
OK, I realise that my original post was a bit premature.

I've created a graph and host template to go with it.

Good luck!


Attachments:
dhcp.png
dhcp.png [ 14.98 KiB | Viewed 51722 times ]
dhcpd-snmp.zip [6.04 KiB]
Downloaded 4113 times
Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 8:10 am 
Offline
Cacti Pro User
User avatar

Joined: Thu Nov 21, 2002 8:55 am
Posts: 703
Location: Austin, TX
Under the data template, you have the Max value set to 254. This is great if the lease is for a 24bit subnet, but I have a 16 bit subnet dhcp scope being dished out from the same dhcp server as well.

I can duplicate the templates and mod the new one for the 16 bit graph and use seperate templates for the different scopes, but I was wondering if there is an easier way? Perhaps make use of the "Use Per-Data Source Value (Ignore this Value)"?

Either way, I have graphs now. Thank you for providing this template.

_________________
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey


Top
 Profile  
 
 Post subject: Re: About Custom datas fields ...
PostPosted: Thu Oct 26, 2006 9:33 am 
Offline

Joined: Wed Sep 06, 2006 12:59 am
Posts: 14
scramatte wrote:
Hello,

Does anyone know which values I must put in 3 custom fields :

Index Type
Index Value
Output Type ID

Seems that without this values the template can't works ...

Regards


same question here :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 10:27 am 
Offline
Cacti Pro User
User avatar

Joined: Thu Nov 21, 2002 8:55 am
Posts: 703
Location: Austin, TX
Couldn't figure out why this was working on 1 dhcp server but not the other...

a quick look at /var/log/messages showed that selinux was blocking it.

a quick "setenforce Permissive" fixed it. I will go back and edit my policies to add the script

_________________
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 11:06 am 
Offline

Joined: Wed Sep 06, 2006 12:59 am
Posts: 14
CdG wrote:
OK, I realise that my original post was a bit premature.

I've created a graph and host template to go with it.

Good luck!


great job!
working perfect :)
mv xml to snmp_queries import other one graphing ;)
thx!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 7:38 am 
Offline

Joined: Tue Jun 20, 2006 9:04 am
Posts: 17
egarnel wrote:
Under the data template, you have the Max value set to 254. This is great if the lease is for a 24bit subnet, but I have a 16 bit subnet dhcp scope being dished out from the same dhcp server as well.

I can duplicate the templates and mod the new one for the 16 bit graph and use seperate templates for the different scopes, but I was wondering if there is an easier way? Perhaps make use of the "Use Per-Data Source Value (Ignore this Value)"?

Either way, I have graphs now. Thank you for providing this template.


This Max value is in the graph template posted by fhuber. The one in the zipfile I posted only has a Max value for expired leases, which I currently do not graph. But I agree: the 'Per-Data Source Value' might be better.

CdG


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 2:28 pm 
Offline

Joined: Thu Oct 26, 2006 11:57 am
Posts: 13
I am trying to follow the direction on how to import this into my cacti but it is just not working.. is there a how-to guide on proper importing of these scripts/ templates...

I keep getting this error msg:

Warning: file(c:/Inetpub/wwwroot/cacti/resource/snmp_queries/dhcpd-snmp.xml) [function.file]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\cacti\lib\data_query.php on line 79

Warning: implode() [function.implode]: Bad arguments. in c:\Inetpub\wwwroot\cacti\lib\data_query.php on line 79

please note my dhcpd is a win2k3 server.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 62 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: fjca, Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group