Hi to all
I have found the way to solve the problem of snmpset commands in Ubuntu 64
bit OS :
In the nstAgentSuabagentObject.c file, I have declared the
nstAgentSubagentObject as long and accordingly invoked the related
netsnmp_register_long_instance function.
See below the modified source code for completeness :
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.int_watch.conf,v 5.0 2002/04/20 07:30:13 hardaker Exp $
*/
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "nstAgentSubagentObject.h"
/*
* the variable we want to tie an OID to. The agent will handle all
* * GET and SET requests to this variable changing it's value as needed.
*/
static long nstAgentSubagentObject = 2;
/*
* our initialization routine, automatically called by the agent
* (to get called, the function name must match init_FILENAME())
*/
void
init_nstAgentSubagentObject(void)
{
static oid nstAgentSubagentObject_oid[] =
{ 1, 3, 6, 1, 4, 1, 8072, 2, 4, 1, 1, 2, 0 };
/*
* a debugging statement. Run the agent with -DnstAgentSubagentObject
to see
* the output of this debugging statement.
*/
DEBUGMSGTL(("nstAgentSubagentObject",
"Initializing the nstAgentSubagentObject module\n"));
/*
* the line below registers our variables defined above as
* accessible and makes it writable. A read only version of any
* of these registration would merely call
* register_read_only_int_instance() instead. The functions
* called below should be consistent with your MIB, however.
*
* If we wanted a callback when the value was retrieved or set
* (even though the details of doing this are handled for you),
* you could change the NULL pointer below to a valid handler
* function.
*/
DEBUGMSGTL(("nstAgentSubagentObject",
"Initalizing nstAgentSubagentObject scalar integer. Default
value = %d\n",
nstAgentSubagentObject));
netsnmp_register_long_instance("nstAgentSubagentObject",
nstAgentSubagentObject_oid,
OID_LENGTH(nstAgentSubagentObject_oid),
&nstAgentSubagentObject, NULL);
DEBUGMSGTL(("nstAgentSubagentObject",
"Done initalizing nstAgentSubagentObject module\n"));
}
With this modification set operations work fine.
Thank you and best regards
Emanuele
-------------------
Emanuele Scalco
Software Engineer - GDS / Global Display Solutions Spa
Via Tezze, 20/A - 36073 Cornedo (Vicenza) - Italy
Phone: +39 0445 428939
Fax: +39 0445 428992
E-mail: [email protected]
This email and any attachments may contain privileged and confidential
information that is intended for the recipient only. If you have received
this transmission in error, please notify the sender by reply and delete it
from your system. You may not copy, nor distribute, nor disclose its
contents.
Go Green! Please do not print this e-mail unless it is completely
necessary.
-----Messaggio originale-----
Da: Emanuele Scalco [mailto:[email protected]]
Inviato: lunedì 18 luglio 2011 15.40
A: 'Wes Hardaker'
Cc: [email protected]
Oggetto: R: Cannot set values in example-demon Subagent
Hi to all
After deeper investigation I have found an interesting result :
With 64 bit version of Ubuntu OS 10.04, I experience the issue described in
my previous e-mail.
With 32 bit version of Ubuntu OS 10.04 no error occurs and I can correctly
execute the set operations.
Is someone knowing if there is any particular package/lib to install in the
64 bit version of the Ubuntu OS in order to correctly run the demo?
Thank you and best regards
Emanuele
-------------------
Emanuele Scalco
Software Engineer - GDS / Global Display Solutions Spa
Via Tezze, 20/A - 36073 Cornedo (Vicenza) - Italy
Phone: +39 0445 428939
Fax: +39 0445 428992
E-mail: [email protected]
This email and any attachments may contain privileged and confidential
information that is intended for the recipient only. If you have received
this transmission in error, please notify the sender by reply and delete it
from your system. You may not copy, nor distribute, nor disclose its
contents.
Go Green! Please do not print this e-mail unless it is completely
necessary.
-----Messaggio originale-----
Da: Emanuele Scalco [mailto:[email protected]]
Inviato: lunedì 18 luglio 2011 9.08
A: 'Wes Hardaker'
Cc: '[email protected]'
Oggetto: R: Cannot set values in example-demon Subagent
Hi Wes
Thank you for the suggestion.
Yes I tried to replace the = with the i character but I still verify the
same problem.
However, I've than provided to install the net-snmp project and execute the
subagent demo in a new fresh installation of Ubuntu 10.04 : in this case
everything works fine.
So I'm trusting it is a problem with my OS configuration...I will try to
make a new and fresh installation of Ubutnu 9.10 OS in order to see if this
also solve the issue.
Thank you and best regards
Emanuele
-------------------
Emanuele Scalco
Software Engineer - GDS / Global Display Solutions Spa
Via Tezze, 20/A - 36073 Cornedo (Vicenza) - Italy
Phone: +39 0445 428939
Fax: +39 0445 428992
E-mail: [email protected]
This email and any attachments may contain privileged and confidential
information that is intended for the recipient only. If you have received
this transmission in error, please notify the sender by reply and delete it
from your system. You may not copy, nor distribute, nor disclose its
contents.
Go Green! Please do not print this e-mail unless it is completely
necessary.
-----Messaggio originale-----
Da: Wes Hardaker [mailto:[email protected]]
Inviato: domenica 17 luglio 2011 18.05
A: Emanuele Scalco
Cc: [email protected]
Oggetto: Re: Cannot set values in example-demon Subagent
>>>>> On Fri, 15 Jul 2011 10:57:46 +0200, Emanuele Scalco <[email protected]>
said:
ES> Error in packet.
ES> Reason: (badValue) The value given has the wrong type or length.
ES> Failed object: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
Odd... Can you try this instead:
snmpset localhost NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 i 5
^
^
^
And see if it makes any difference?
--
Wes Hardaker
SPARTA, Inc.
----------------------------------------------------------------------------
--
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
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
------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
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