[2013/05/21 01:31:00] #net-snmp <lloowen> Hello all! Is there a way to force snmp to only use v3?
[2013/05/21 05:04:19] #net-snmp <rstory-work> lloowen: yes - don't define any v1/v2 community string access in snmpd.conf.. the agent will still accept v1/v2, but will reject v1/v2 packets because of lack of authorization..
[2013/05/21 05:06:52] #net-snmp <rstory-work> if you don't mind rebuilding, you can build the agent without v1 support..
[2013/05/21 05:07:45] #net-snmp <rstory-work> foster123: you don't have to use OIDs.. you can configure the library to load the MIBs (in snmp.conf [not snmpd.conf]), and then you can use the names instead of raw OIDs
[2013/05/21 05:56:09] #net-snmp <grummund> Hi all, i'm using a customised mib2c.scalar.conf to generate C handler functions,
[2013/05/21 05:56:42] #net-snmp <grummund> scalar names are of the form fooBar12345
[2013/05/21 05:57:30] #net-snmp <grummund> is there a way to extract the prefix text and the suffix number as separate variables for use in the mib2c conf?
[2013/05/21 05:58:47] #net-snmp <rstory-work> not directly, but it's all perl so you should be able to do it with a regexp..
[2013/05/21 06:00:40] #net-snmp <grummund> hmm, my perl is flakey but i can probably figure it out... are there examples i could look at?
[2013/05/21 06:01:20] #net-snmp <grummund> i guess grep the mib2c conf files for @eval
[2013/05/21 06:25:38] #net-snmp <lloowen> rstory-work: Thanks for the tip. By the way can you recommend a good forum for snmp support?
[2013/05/21 09:26:39] #net-snmp <grummund> Anyone know if it's possible to use $var.blah vars in a mib2c @perleval expression?
[2013/05/21 09:27:27] #net-snmp <grummund> $var.uc $var.objectID $var.module etc.?
[2013/05/21 10:06:23] #net-snmp <rstory-work> lloowen: no, not really. there's the net-snmp mailing lists, and i think there's a usenet snmp group..
[2013/05/21 12:04:42] #net-snmp <fenestro> grummund: you can't, but for most of them you can reach into the actual perl data structure, %vars ($vars{'var'} is $var, $vars{'i'} is $i) and then look in %MIBS for things like objectID and module, $SNMP::MIB{ $vars{ 'i' } }->{module}
[2013/05/21 12:05:50] #net-snmp <fenestro> grummund: if you look in the process_vars function inside mib2c you can find the relevant code for each of the substitutions
[2013/05/21 14:18:55] #net-snmp <grummund> fenestro: thanks
[2013/05/21 14:23:22] #net-snmp <grummund> unfortunately i'm a perl noob, but i did make this work:
[2013/05/21 14:23:46] #net-snmp <grummund> @eval $val_type = $i.syntax@
[2013/05/21 14:23:51] #net-snmp <grummund> @perleval $vars{'val_type'} =~ s/^.[a-z]*//; 0;@
[2013/05/21 14:24:58] #net-snmp <grummund> it strips the 1st component from a CamelCase name and assigns the remainder to $val_type
[2013/05/21 14:42:23] #net-snmp <fenestro> fascinating
[2013/05/21 14:45:08] #net-snmp <grummund> and there is this:
[2013/05/21 14:45:23] #net-snmp <grummund> @perleval $vars{'id'} = $vars{'i'} =~ m/([1-9][0-9]+)\Z/ ? $1 : undef; 0;@
[2013/05/21 14:46:19] #net-snmp <grummund> which graps the trailing digits from e.g. FooBar12345 and assigns to $id
[2013/05/21 14:46:26] #net-snmp <grummund> *grabs
[2013/05/21 14:50:11] #net-snmp <fenestro> not any worse than most other perl ;-)
[2013/05/21 14:52:41] #net-snmp <grummund> indeed ;-)