Help creating data template for indexed (?) OIDs

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
User avatar
Cylindric
Cacti User
Posts: 54
Joined: Mon Jul 16, 2007 9:32 am

Help creating data template for indexed (?) OIDs

Post by Cylindric »

Not sure if I'm using the correct terminology, but I was wondering if was possible to create a data template that will accept a parameter for an OID-part?

For example, the size of a MS SQL database is at
.1.3.6.1.4.1.311.1.4.1.1.6.1.5.1

But that's just for the first db. The second and subsequent are at
.1.3.6.1.4.1.311.1.4.1.1.6.1.5.2
.1.3.6.1.4.1.311.1.4.1.1.6.1.5.3
.1.3.6.1.4.1.311.1.4.1.1.6.1.5.4
etc

Do I have to just make the data-template's OID field overridable, and change the last digit? Or can I somehow get it dynamically?

Basically, the name of the database is at
.1.3.6.1.4.1.311.1.4.1.1.6.1.2.1

so it would be great to be able to set it up so I can add a counter for a device by specifying a name, which would look through
.1.3.6.1.4.1.311.1.4.1.1.6.1.2.x to find the last digit, then use that to find the size in
.1.3.6.1.4.1.311.1.4.1.1.6.1.5.x


[edit]I think this is what indexed SNMP type is for?[/edit]
Last edited by Cylindric on Mon Jul 23, 2007 8:42 am, edited 1 time in total.
Server: Windows Server 2008 R2 x64 (running on a VM, 4Gb RAM)
Cacti: 0.8.8a (using cmd, 270 datasources in 145s)
MySQL: 5.5.16, Apache: 2.2.21, PHP: 5.3.16
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Find help at http://docs.cacti.net/node/227
Reinhard
User avatar
Cylindric
Cacti User
Posts: 54
Joined: Mon Jul 16, 2007 9:32 am

Post by Cylindric »

\o/ that's the thing :) Thanks for the pointer, I just didn't know what to start looking for!
Last edited by Cylindric on Mon Jul 23, 2007 8:42 am, edited 1 time in total.
Server: Windows Server 2008 R2 x64 (running on a VM, 4Gb RAM)
Cacti: 0.8.8a (using cmd, 270 datasources in 145s)
MySQL: 5.5.16, Apache: 2.2.21, PHP: 5.3.16
User avatar
Cylindric
Cacti User
Posts: 54
Joined: Mon Jul 16, 2007 9:32 am

Post by Cylindric »

So far so good, I think I'm just hitting a wall with my lack of SNMP knowledge.

snmpwalk gives me a list of OIDs corresponding to the values I'm after, but snmpget on of those fails. I'm confused now, as I thought the OID returned by snmpwalk should just work in snmpget?

Code: Select all

# snmpwalk -c CactiSNMP -On -v 1 192.168.1.208 .1.3.6.1.4.1.311.1.4.1.1.6.1.6
.1.3.6.1.4.1.311.1.4.1.1.6.1.6.1 = INTEGER: 1600
.1.3.6.1.4.1.311.1.4.1.1.6.1.6.2 = INTEGER: 20380
.1.3.6.1.4.1.311.1.4.1.1.6.1.6.3 = INTEGER: 230
.1.3.6.1.4.1.311.1.4.1.1.6.1.6.4 = INTEGER: 1530
.1.3.6.1.4.1.311.1.4.1.1.6.1.6.5 = INTEGER: 9660
.1.3.6.1.4.1.311.1.4.1.1.6.1.6.8 = INTEGER: 550950
.1.3.6.1.4.1.311.1.4.1.1.6.1.6.9 = INTEGER: 0
.1.3.6.1.4.1.311.1.4.1.1.6.1.6.10 = INTEGER: 2450
But

Code: Select all

# snmpget -c CactiSNMP -On -v 1 192.168.1.208 .1.3.6.1.4.1.311.1.4.1.1.6.1.6.1
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.311.1.4.1.1.6.1.6.1
My Cacti log says

Code: Select all

CMDPHP: Poller[0] Host[10] DS[292] SNMP: v2: servername, dsname: mssqlDbInfoSize, oid: .1.3.6.1.4.1.311.1.4.1.1.6.1.2.8, output: U
CMDPHP: Poller[0] Host[10] DS[292] WARNING: Result from SNMP not valid. Partial Result:
What does output "U" mean?
Server: Windows Server 2008 R2 x64 (running on a VM, 4Gb RAM)
Cacti: 0.8.8a (using cmd, 270 datasources in 145s)
MySQL: 5.5.16, Apache: 2.2.21, PHP: 5.3.16
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

This snmp behaviour is really strange. I did not find any typo.
The U stands for unknown saying, that there's no valid data returned.
Reinhard
User avatar
Cylindric
Cacti User
Posts: 54
Joined: Mon Jul 16, 2007 9:32 am

Post by Cylindric »

Damn, I was really hoping you'd say I was being a fool and just had to tick a box or add a command-line parameter :D

snmpget does the same from the Cacti host and from my PC by the way, so it looks like something odd with the MSSQL SNMP or Windows SNMP :(

Maybe I'll have to implement some kind of script-based approach, that polls the database folder on the SQL host or something. Shame really, I was really getting to like the SNMP-only approach :D
Server: Windows Server 2008 R2 x64 (running on a VM, 4Gb RAM)
Cacti: 0.8.8a (using cmd, 270 datasources in 145s)
MySQL: 5.5.16, Apache: 2.2.21, PHP: 5.3.16
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

You may want to post a similar thread to the windows forums. Perhaps you find more help there. Surely, you've already scanned the Script and Templates forum for MSSQL ressources?
Reinhard
User avatar
Cylindric
Cacti User
Posts: 54
Joined: Mon Jul 16, 2007 9:32 am

Post by Cylindric »

Unfortunately, WMI abounds. I'm running a Linux Cacti though. I'll keep digging, I did see a reference about the MIBs not being installed on the server if SNMP is innactive when SQL is actually installed, so I'll have a look into that aspect.
Server: Windows Server 2008 R2 x64 (running on a VM, 4Gb RAM)
Cacti: 0.8.8a (using cmd, 270 datasources in 145s)
MySQL: 5.5.16, Apache: 2.2.21, PHP: 5.3.16
User avatar
Cylindric
Cacti User
Posts: 54
Joined: Mon Jul 16, 2007 9:32 am

Post by Cylindric »

Okay, couldn't work out why snmpget doesn't work. I've seen some references to comments made by MS techs, but not found any detail. It seems the implementation of the SNMP is a bit odd for MSSQL (other MS stuff too?).

I've created a Query Script to do this instead. It basically uses snmpgetnext with an id of one less than requested, which seems to do the trick.

Posted at http://forums.cacti.net/viewtopic.php?t=22484
Server: Windows Server 2008 R2 x64 (running on a VM, 4Gb RAM)
Cacti: 0.8.8a (using cmd, 270 datasources in 145s)
MySQL: 5.5.16, Apache: 2.2.21, PHP: 5.3.16
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests