2007/3/5, [EMAIL PROTECTED] <
[EMAIL PROTECTED]>:

Send Net-snmp-users mailing list submissions to
       [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
       https://lists.sourceforge.net/lists/listinfo/net-snmp-users
or, via email, send a message with subject or body 'help' to
       [EMAIL PROTECTED]

You can reach the person managing the list at
       [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Net-snmp-users digest..."


Today's Topics:

  1. linux core net-snmp management (Iacopo Masi)
  2. Problem with vp->magic (Shuaib Siddiqui)


----------------------------------------------------------------------

Message: 1
Date: Mon, 5 Mar 2007 01:12:24 +0100
From: Iacopo Masi <[EMAIL PROTECTED]>
Subject: linux core net-snmp management
To: [email protected]
Cc: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"

Hello everybody,
we are two Italian students interested in net management, Iacopo and
Marco.

I'm wondering about how can I use net-snmp agent to create the agent layer
dealing with a Snapgear Linux emebedded system.

In particular I would like to know how to manage this parts of linux
system:

       - LAN interfaces
       - WLAN interfaces
       - Static and Dynamic Routing
       - Firewalling
       - ....

For example, let's take the Firewall example, that is covered in linux by
iptables and netfilter. I would create a snmp agent that could get the
list
of iptables entries for all chains and all tables. And by the way the
agent
could receive a snmpset command to add some new rules.

How do I create this?
[1]Should I write a MIB modules for each service (firewall etc..) and then
with MIB for Dummies tutorial, generate the code for the subagent and
coding
it inside.
Or
[2] Should I use the option of snmp to run particle scripts on the agent
platform and get/set the value I need?

In other way, Should I deal with "/proc/net/dev" or with "ifconfig" for
the
example of teh LAN interfaces?

Do you have some good guide about [1] and [2], premised that I have
already
read the wiki tutorial?

Many thanks.

--
Iacopo Masi
Marco Meoni
www.iacopomasi.net
www.marcomeoni.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available

------------------------------

Message: 2
Date: Mon, 5 Mar 2007 10:51:26 +0100
From: "Shuaib Siddiqui" <[EMAIL PROTECTED]>
Subject: Problem with vp->magic
To: [email protected]
Message-ID:
       <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

I have extended the UCD-SNMP agent with a MIB module. The vp->magic
appears
to be 1 less than what it should be, which causes the value of object
above
it to be returned. Following is Code of the variable structure, definition
of the magic numbers from the header file and in the end i'll describe the
unusual behavior.

struct variable7 sPlc_variables[] = {
{ _infoHardwareVersion,     ASN_OCTET_STR,  RONLY,  var_alpsPlc,    2,
{1,1} },
{ _infoFirmwareVersion,     ASN_OCTET_STR,  RONLY,  var_alpsPlc,    2,
{1,2} },
{ _infoBuildDate,   ASN_OCTET_STR,  RONLY,  var_alpsPlc,    2,      {1,3}
},
{ _infoFlashParamsNotSaved, ASN_INTEGER,    RONLY,  var_alpsPlc,    2,
{1,4} },
{ _infoFlashChanged,        ASN_INTEGER,    RONLY,  var_alpsPlc,    2,
{1,5} },
{ _nodeType,        ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,1,1}
},
{ _freqBand,        ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,1,2}
},
{ _customFreqBandIdx,       ASN_INTEGER,    RONLY,
var_alpscustomFreqBandTable,    5,      {2,1,3,1,1} },
{ _customFreqBandCenterFreq,        ASN_INTEGER,    RWRITE,
var_alpscustomFreqBandTable,    5,      {2,1,3,1,2} },
{ _customFreqBandBandwidth, ASN_INTEGER,    RWRITE,
var_alpscustomFreqBandTable,    5,      {2,1,3,1,3} },
{ _customFreqBandRowStatus, ASN_INTEGER,    RWRITE,
var_alpscustomFreqBandTable,    5,      {2,1,3,1,4} },
{ _preferredBandTimeout,    ASN_INTEGER,    RWRITE, var_alpsPlc,    3,
{2,1,4} },
{ _powerMask30,     ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,1,5}
},
{ _powerMaskIARU,   ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,1,6}
},
{ _agcTxEnable,     ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,1,7,1} },
{ _agcRxEnable,     ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,1,7,2} },
{ _agcTxGain,       ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,1,7,3} },
{ _agcRxGain,       ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,1,7,4} },
{ _masterSelectionEnable,   ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,1,8,1} },
{ _masterSelectionCriteria, ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,1,8,2} },
{ _masterSelectionNumOfHops,        ASN_INTEGER,    RWRITE, var_alpsPlc,
4,      {2,1,8,3} },
{ _masterSelectionFixed,    ASN_OCTET_STR,  RWRITE, var_alpsPlc,    4,
{2,1,8,4} },
{ _firmwareUpgradeURL,      ASN_OCTET_STR,  RWRITE, var_alpsPlc,    4,
{2,2,1,1} },
{ _configFileDownloadURL,   ASN_OCTET_STR,  RWRITE, var_alpsPlc,    4,
{2,2,1,2} },
{ _configFileUploadURL,     ASN_OCTET_STR,  RWRITE, var_alpsPlc,    4,
{2,2,1,3} },
{ _saveParamsInFlash,       ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,2,2,1} },
{ _restoreFactoryDefaults,  ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,2,2,2} },
{ _upgradeFirmware, ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,2,2,3} },
{ _upgradeCongFile, ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,2,2,4} },
{ _deviceReboot,    ASN_INTEGER,    RWRITE, var_alpsPlc,    4,
{2,2,2,5} },
{ _vlanEnabled,     ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,3,1}
},
{ _vlanType,        ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,3,2}
},
{ _vlanDataID,      ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,3,3}
},
{ _vlanMgmtID,      ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,3,4}
},
{ _vlanDataPriority,        ASN_INTEGER,    RWRITE, var_alpsPlc,    3,
{2,3,5} },
{ _vlanMgmtPriority,        ASN_INTEGER,    RWRITE, var_alpsPlc,    3,
{2,3,6} },
{ _qosEnabled,      ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,4,1}
},
{ _qosClass,        ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,4,2}
},
{ _qosUplinkLimit,  ASN_INTEGER,    RWRITE,
var_alpsPlc,    3,      {2,4,3}
},
{ _qosDownlinkLimit,        ASN_INTEGER,    RWRITE, var_alpsPlc,    3,
{2,4,4} },
{ _aclAdminIdx,     ASN_INTEGER,    RONLY,  var_alpsaclAdminTable,  6,
{2,5,1,1,1,1} },
{ _aclAdminHost,    ASN_OCTET_STR,  RWRITE, var_alpsaclAdminTable,  6,
{2,5,1,1,1,2} },
{ _aclAdminRowStatus,       ASN_INTEGER,    RWRITE, var_alpsaclAdminTable,
6,      {2,5,1,1,1,3} }
};

#define _infoHardwareVersion                                1
#define _infoFirmwareVersion                                2
#define _infoBuildDate                                      3
#define _infoFlashParamsNotSaved                            4
#define _infoFlashChanged                                   5
#define _nodeType                                           6
#define _freqBand                                           7
#define _preferredBandTimeout                               12
#define _powerMask30                                        13
#define _powerMaskIARU                                      14
#define _agcTxEnable                                        15
#define _agcRxEnable                                        16
#define _agcTxGain                                          17
#define _agcRxGain                                          18
#define _masterSelectionEnable                              19
#define _masterSelectionCriteria                            20
#define _masterSelectionNumOfHops                           21
#define _masterSelectionFixed                               22
#define _firmwareUpgradeURL                                 23
#define _configFileDownloadURL                              24
#define _configFileUploadURL                                25
#define _saveParamsInFlash                                  26
#define _restoreFactoryDefaults                             27
#define _upgradeFirmware                                    28
#define _upgradeCongFile                                    29
#define _deviceReboot                                       30
#define _vlanEnabled                                        31
#define _vlanType                                           32
#define _vlanDataID                                         33
#define _vlanMgmtID                                         34
#define _vlanDataPriority                                   35
#define _vlanMgmtPriority                                   36
#define _qosEnabled                                         37
#define _qosClass                                           38
#define _qosUplinkLimit                                     39
#define _qosDownlinkLimit                                   40

#define CONF_customFreqBandIdx                                  1
#define CONF_customFreqBandCenterFreq                           2
#define CONF_customFreqBandBandwidth                            3
#define CONF_customFreqBandRowStatus                            4

#define CONF_aclAdminIdx                                       1
#define CONF_aclAdminHost                                      2
#define CONF_aclAdminRowStatus                                 3

The location where this module is registered within the MIB tree is:  oid
sPlc_variables_oid[] = { 1,3,6,1,4,1,188,11,10 };
If I print the value of vp->magic from the method: search_subtree_vars()
in
the File: snmp_vars.c, will return 29 for the Object deviceReboot, whose
actual magic number is 30. Its similar with all the objects above the
Object
deviceReboot but it returns correct value for the Objects that are below
it.
I also printed the vp->magic from within my variable handling routine but
the behavior is the same. Does anyone has an idea why this is happening?
Thank you for your time!

Shuaib
--
MSc in Communication Systems
I&C Faculty
EPFL
Switzerland
Home page: http://shuaibe.googlepages.com/
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

------------------------------

_______________________________________________
Net-snmp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


End of Net-snmp-users Digest, Vol 10, Issue 14
**********************************************

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to