Hello there,
I've concentrated on getting to know SNMP and Net-SNMP this month, and now I'd
like to ask for your help.
My story:
I've got the purpose, to be able to get and set hostname and date from a new,
own MIB on my localhost. It doesn't sound so difficult, but I can't manage it
unfortunately.
Until now I could only get and set an integer type from my MIB.
-this is my MIB: UHMIB.txt
There are three nodes/objects in it: hostname, date and a number.
1. Have I defined them well?
2. What is DEFVAL for?
3. Should I use it for hostname and date, too?
4. Do I have to write .c and .h files for every single one object? (One for
the hostname and one for date and so on...?) Isn't there any other methods? I
guess there is, only I don't know it yet..
I've written a .c and .h for the number object, it's like the .c and .h files
in the tutorial, and it works.
I tried the same with the hostname: here it is: mfmHostname.c, .h.
I've put these to agent/mibgroup, and gave the commands
'./configure --with-mib-modules=mfmHostname ', (v2c)
make,
make install,
/usr/local/sbin/snmpd,
export MIBS=+UHMIB .
snmptranslate .1.3.6.1.4.1.3.1.2
- UHMIB::mfmHostname
snmpget -v2c -c public localhost UHMIB::mfmHostname.0
- No such object available on this agent at this OID.
snmpset -v2c -c private localhost UHMIB::mfmHostname.0 = bla
- Error in packet.
- Reason: notWritable (supports no modification)
So, here I stand now.
5. ? :) What did I wrong?
6. Where could I find the .c files for the objects already existing and
functioning? For example, I stole my mfmHostname from SNMPv2-MIB::sysName.0. I
defined it the same way, I had to get it the same way, too... Any suggestions?
7. How would the .c file for the date look? (Isn't there anybody wanting to do
my job for me?: ) ...was a joke)
Forgive me that I'm so badly a beginner. But at least I'm very snoopy, too,
and eager to do it right.
Thanks a lot and best wishes,
Nikolett
__
Névreszóló takarók - kíváló ajándék születésre, szülinapra, névnapra.
http://www.takoo.hu
UHMIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE, Integer32,
MODULE-IDENTITY FROM SNMPv2-SMI
DisplayString, DateAndTime FROM SNMPv2-TC;
uhmib MODULE-IDENTITY
LAST-UPDATED 20070718Z
ORGANIZATION SSI Schaefer PEEM
CONTACT-INFO
SSI Schaefer PEEM
Postal:
Tel:
E-mail:
DESCRIPTION
The Structure of Management Information for the
First MIB.
REVISION 20070720Z
DESCRIPTION
Initial version of this MIB module.
::= { enterprises 3}
internetOBJECT IDENTIFIER ::= {iso(1) org(3) dod(6) 1}
enterprises OBJECT IDENTIFIER ::= {internet(1) private(4) 1}
sysInfo OBJECT IDENTIFIER ::= {uhmib 1}
mfmUhrzeit OBJECT-TYPE
SYNTAX DateAndTime
MAX-ACCESS read-write
STATUS current
DESCRIPTION
hrSystemDate.0
::={sysInfo 1}
mfmHostname OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
MAX-ACCESS read-write
STATUS current
DESCRIPTION
sysName.0
::={sysInfo 2}
mfmNumber OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION just an integer
DEFVAL { 6 }
::= { sysInfo 3}
END
mfmHostname.c
Description: Binary data
mfmHostname.h
Description: Binary data
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now http://get.splunk.com/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users