Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jul 25, 2017 11:41 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: OID Tree, Branch Counter
PostPosted: Sat Jan 19, 2008 3:42 pm 
Offline
Cacti User
User avatar

Joined: Sun Jul 24, 2005 12:20 pm
Posts: 120
Location: Ireland, Dublin
How it works:

You provide an OID that, via snmpwalk will return other OID's, then they will be counted and given to cacti poller to graph them...

ex.
Under 1.3.6.1.2.1.4.22.1.4 there is information about ARP Table, but there is no OID to provide the number of records, so you have to count them somehow...

Code:
~# snmpwalk -v 1 -c public 10.86.87.110 1.3.6.1.2.1.4.22.1.4
IP-MIB::ipNetToMediaType.2.10.86.87.129 = INTEGER: dynamic(3)
IP-MIB::ipNetToMediaType.2.10.86.89.130 = INTEGER: dynamic(3)
IP-MIB::ipNetToMediaType.2.10.86.89.131 = INTEGER: dynamic(3)
IP-MIB::ipNetToMediaType.2.10.86.89.133 = INTEGER: dynamic(3)
IP-MIB::ipNetToMediaType.3.10.86.87.109 = INTEGER: dynamic(3)

~# snmpwalk -v 1 -c public 10.86.87.110 1.3.6.1.2.1.4.22.1.4 | wc -l | awk '{printf$0}'

5~#



Note: This is a very usable template has it been posted again ?


Attachments:
cacti_graph_template_unix_-_oid_counter.xml [9.84 KiB]
Downloaded 913 times

_________________
[i]Born to be online![/i]
Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 20, 2008 5:02 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Thank you for your contribution.
I would recommend, placing /full/path/to/everything for external command into your shell script. In general, cactiuser has not necessarily the same $PATH settings!
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 20, 2008 5:08 pm 
Offline
Cacti User
User avatar

Joined: Sun Jul 24, 2005 12:20 pm
Posts: 120
Location: Ireland, Dublin
this is a bit problem... :-?

I used not to prefer full paths because, I use custom compiled tools (ex php, net-snmp) and in my system are.. /usr/local/php/bin/php

... and at other systems /usr/sbin/php

I will try to fix all of my work :)

_________________
[i]Born to be online![/i]


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 20, 2008 5:13 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
mojiro wrote:
this is a bit problem... :-?
Confirmed. You may simply provide a README that tells the user what to do. And perhaps make the script stop if nothing is configured.
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 23, 2008 4:35 am 
Offline
Cacti User
User avatar

Joined: Sun Jul 24, 2005 12:20 pm
Posts: 120
Location: Ireland, Dublin
I think... that using variable:|path_php_binary|

in my scripts/templates is better..., isn't it ? :)

edit:

I think there is one for snmpwalk, or I am wrong ?

_________________
[i]Born to be online![/i]


Top
 Profile  
 
 Post subject: Re: OID Tree, Branch Counter
PostPosted: Mon Mar 27, 2017 3:22 pm 
Offline
User avatar

Joined: Tue Jun 30, 2009 11:26 am
Posts: 32
Hi, I am trying to use the script, but the graph always shows 0.

I tried with the oid 1.3.6.1.2.1.4.22.1.4 and 1.3.6.1.2.1.4.22.1.2, but there is no difference.

what coudl be wrong, I did not found the system paths, that you were talking about, on the xml files...


Attachments:
data source.PNG
data source.PNG [ 32.7 KiB | Viewed 555 times ]
data input.PNG
data input.PNG [ 25.91 KiB | Viewed 555 times ]
Top
 Profile  
 
 Post subject: Re: OID Tree, Branch Counter
PostPosted: Mon Mar 27, 2017 3:58 pm 
Offline
Cacti User
User avatar

Joined: Sun Jul 24, 2005 12:20 pm
Posts: 120
Location: Ireland, Dublin
are you sure that this OID gives results?

_________________
[i]Born to be online![/i]


Top
 Profile  
 
 Post subject: Re: OID Tree, Branch Counter
PostPosted: Mon Mar 27, 2017 6:20 pm 
Offline
User avatar

Joined: Tue Jun 30, 2009 11:26 am
Posts: 32
Yes, even I exceuted the script in a console and I got a result.

see the images.


Attachments:
oid 2.png
oid 2.png [ 2.55 KiB | Viewed 533 times ]
oid 1.png
oid 1.png [ 4.77 KiB | Viewed 533 times ]
Top
 Profile  
 
 Post subject: Re: OID Tree, Branch Counter
PostPosted: Tue Mar 28, 2017 4:47 pm 
Offline
Cacti User
User avatar

Joined: Sun Jul 24, 2005 12:20 pm
Posts: 120
Location: Ireland, Dublin
do they following test:
- give temporary ssh/terminal access to www-data/apache/nginx user + password
- login as www-data/apache/nginx user
- execute

I think it fails because some of the apps (snmpwalk, wc, awk) are either only in sbin either are not in that user's $PATH.

If it is $PATH issue, do:
Code:
# whereis awk
awk: /usr/bin/awk /usr/share/awk /usr/share/man/man1/awk.1.gz

... and replace awk with /usr/bin/awk

do the same for snmpwalk and wc.

In any other case... post here and we will check it :)

_________________
[i]Born to be online![/i]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 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