Some way to add and modify multiple OID's...

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
NoID
Posts: 12
Joined: Wed Apr 20, 2005 4:00 pm

Some way to add and modify multiple OID's...

Post by NoID »

Ok, this is what I need to do. A device I am monitoring creates an OID everytime a user has a VPN connection to it.

for example...
OID Value
.1.3.......1.1.1 0
.1.3.......1.1.2 1
.1.3.......1.1.3 2
.1.3.......1.1.4 3
etc.

What I would like to do is find a way to poll a bunch of OIDs and plot the great returned value +1 (thus showing a user count). Where do I start?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Does the MIB currently include an OID of the number of children similar to the ifMib? If so, that's your answer. Otherwise, a simple php script server script to walk the tree and return the number of rows is what I see as your answer.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
NoID
Posts: 12
Joined: Wed Apr 20, 2005 4:00 pm

Post by NoID »

Hey, this stuff sure is confusing. First off, I am running Cacti on a W2k3 server. Secondly here is what happens when a user connects via VPN.

If there are currently 0 users connected than the MIB tree terminates at:
.1.3.6.1.4.1.12356.9.1.1

When the first user connects, the following OID is available:
.1.3.6.1.4.1.12356.9.1.1.1.1 returns 0

When the second user connects, the following OIDs are available:
.1.3.6.1.4.1.12356.9.1.1.1.1 returns 0
.1.3.6.1.4.1.12356.9.1.1.1.2 returns 1

When the third user connects, the following OIDs are available:
.1.3.6.1.4.1.12356.9.1.1.1.1 returns 0
.1.3.6.1.4.1.12356.9.1.1.1.2 returns 1
.1.3.6.1.4.1.12356.9.1.1.1.3 returns 2

Let's say the second user disconnects. Then the following OIDs are available:
.1.3.6.1.4.1.12356.9.1.1.1.1 returns 0
.1.3.6.1.4.1.12356.9.1.1.1.3 returns 2

I guess what I am looking for is a script that can check 20 OIDs. If the OID is valid then return a "1" for that OID. Do that for each OID I list, and then sum up the "1"s that should yield a current VPN user count. The device is a Fortinet F60 and I wish there was an OID that did this automatically, but I have walked the whole treee and found nothing.

Simply put, I have no idea how to script for cacti. So any help, be it a really good tutorial, the finished script, a skeleton script, anything, would be greatly appreciated. Thanks in advance!!!
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

How many of these devices do you intend on graphing?

TheWitness :D
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
NoID
Posts: 12
Joined: Wed Apr 20, 2005 4:00 pm

Post by NoID »

Right now there is only one. In the future, I don;t see me adding anymore VPN endpoints to my network. So, to answer your questions.... 1.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This one is easy in a php script server. YOu will walk the entire mib using cacti_snmp_walk and then count the total rows using the "sizeof" command and that will be the number of connected users. You don't need to go anywhere otherthan there.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
NoID
Posts: 12
Joined: Wed Apr 20, 2005 4:00 pm

Post by NoID »

How do I do that?
NoID
Posts: 12
Joined: Wed Apr 20, 2005 4:00 pm

Post by NoID »

Is there a good sample script that I can work with to attempt this?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The ss_host_cpu.php is a good one. Focus on the Index portion. The sizeof parameter is the number of connections. However, you are not running a query but rather a script server script similar to ss_sql.php

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
NoID
Posts: 12
Joined: Wed Apr 20, 2005 4:00 pm

Post by NoID »

Alright, I'll disect it this week. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest