MIB read/write(snmpwalk/snmpset) problem

2013-02-18 Thread bensassi youssef
Hi,

I created a MIB, and tried to allocate values to new OID

You find attached my MIB file, data_set.c and data_set.h.

After that I copied the files  data_set.c and data_set.h in the source
directory of Net-SNMP: net-snmp-5.1.1/agent/mibgroup /

I continued as follows :


# ./configure --with-mib-modules="data_set host"
# make
# sudo make install

after that I started the SNMP agent :

#/etc/init.d/snmpd start


 Then i tried to see if the daemon knows about *new enterprise*, for this
reason i did :

#snmpwalk -v 2c -c private 127.0.0.1 .1.3.6.1.4.1.4890.1.1

which outputs are : SNMPv2-SMI::enterprises.4890.1.1 = No Such Object
available on this agent at this OID

So I guess that snmpd is telling me he can't find anything under this tree,
because nothing has been set yet.

So I tried to set this test variable with snmpset on the shell command :

#snmpset -v 2c -c private 127.0.0.1 .1.3.6.1.4.1.4890.1.1.2.\"mtdcsun0\" i
89

which outputs are :

Error in packet.
Reason: notWritable (That object does not support modification)
Failed object:
SNMPv2-SMI::enterprises.4890.1.23.2.8.109.116.100.99.115.117.110.48

and as root, but with no success

But when I do a snmptranslate, I can see that the MIB is parsed correctly
Would you help me to solve my problem ?

Best regards,
BENSASSI Youssef
Software engineer
PING-TABLE-MIB DEFINITIONS ::= BEGIN

IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, Integer32, Opaque, enterprises  FROM SNMPv2-SMI
SnmpAdminString   FROM SNMP-FRAMEWORK-MIB
RowStatus, StorageTypeFROM SNMPv2-TC
InetAddressType, InetAddress  FROM INET-ADDRESS-MIB
;

xavier MODULE-IDENTITY
LAST-UPDATED "20020206Z"
ORGANIZATION "STMicroelectronics"
CONTACT-INFO   
"postal:  Xavier Dumas
 email:main.ja...@mageos.com"
DESCRIPTION
   "The XAV Demonstration MIB."
::= { enterprises 4890 }

pingTableAvgstore OBJECT-TYPE
SYNTAX  SEQUENCE OF NetSnmpIETFWGEntry
MAX-ACCESS  not-accessible
STATUS  current
DESCRIPTION
   "Entrée du tableau."
::= { xavier 1 }

Double ::= TEXTUAL-CONVENTION
STATUS  current
DESCRIPTION
"Definition du type Double"
SYNTAX Opaque (SIZE(11))

pingTableAvgEntry OBJECT-TYPE
SYNTAX  PingTableAvgEntry
MAX-ACCESS  not-accessible
STATUS  current
DESCRIPTION
   "A row describing a given working group"
INDEX   { pingAvgName }
::= {pingTableAvgstore 1 }



PingTableAvgEntry ::= SEQUENCE {
   pingAvgName   OCTET STRING,
   entier   INTEGER,
   entier   INTEGER,
   reels   Double
}

pingAvgName OBJECT-TYPE
SYNTAX  OCTET STRING (SIZE(1..32))
MAX-ACCESS  not-accessible
STATUS  current
DESCRIPTION
   "Sous nom de l’index"
::= { pingTableAvgEntry 1 }

entier OBJECT-TYPE
SYNTAX  INTEGER
MAX-ACCESS  read-create
STATUS  current
DESCRIPTION
   "Nom du tableau commencant par l’OID 2"
::= { pingTableAvgEntry 2 }

entier OBJECT-TYPE
SYNTAX  INTEGER
MAX-ACCESS  read-create
STATUS  current
DESCRIPTION
   " Nom du tableau commencant par l’OID 3"
::= { pingTableAvgEntry 3 }

reels OBJECT-TYPE
SYNTAX  Double
MAX-ACCESS  read-create
STATUS  current
DESCRIPTION
   " Nom du tableau commencant par l’OID 4"
::= { pingTableAvgEntry 4 }

END
// Fichiers a inclure
#include 
#include 
#include 

void
init_data_set(void)
{
netsnmp_table_data_set *table_set;
netsnmp_table_row *row;

//OID ou sera accessible le tableau
oid my_registration_oid[] =
{ 1, 3, 6, 1, 4, 1, 4890, 1 };


// outils de debugage en cas de problème
DEBUGMSGTL(("data_set",
"Initalizing dataset table\n"));

table_set = netsnmp_create_table_data_set("pingTableAvgstore");

//autorise la création d’une nouvelle ligne par snmpset
table_set->allow_creation = 1;

//décrit la structure de l’index d’une ligne
netsnmp_table_dataset_add_index(table_set, ASN_OCTET_STR);

//décrit la structure d’une colonne
netsnmp_table_set_multi_add_default_row(table_set,
/*
* colonne 2 = INTEGER,
* écriture possible = 1,
* valeur par défaut = NULL,
* longueur par défaut = 0
*/
2, ASN_INTEGER, 1, NULL, 0,
/*
* même colonne
*/
3, ASN_INTEGER, 1, NULL, 0,
/*
* avec des réels
*/
4, ASN_OPAQUE_DOUBLE, 1, NULL, 0,
 

  0 /* done */ );

//enregistre le tableau
netsnmp_register_table_data_set(netsnmp_create_handler_registration
("pingTableAvgstore", NULL,
 my_registration_oid,
 OID_LENGTH(my_registration_oid),
 HANDLER_CAN_RWRITE), table_set, NULL);

DEBUGMSGTL(("data_s

Re: snmpset problem

2010-09-04 Thread Shu Hung (Koala)
So I can't have the same community name for both 'rwcommunity' and
'rocommunity' ...

I removed the rocommunity line and it gets better:

Error in packet.
Reason: notWritable (That object does not support modification)
Failed object: UCD-DEMO-MIB::ucdDemoPublicString.0

At least I have some positive result :)
Thanks a lot.


On Sat, Sep 4, 2010 at 01:02, Wes Hardaker
wrote:

>
> You might try a different community than "public".  I'm betting that you
> have a 'rocommunity' with public around as well and it's conflicting.
>
> --
> Wes Hardaker
> Cobham Analytic Solutions
>
--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd___
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


Re: snmpset problem

2010-09-03 Thread Wes Hardaker

You might try a different community than "public".  I'm betting that you
have a 'rocommunity' with public around as well and it's conflicting.

-- 
Wes Hardaker
Cobham Analytic Solutions

--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
___
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


snmpset problem

2010-08-26 Thread Shu Hung (Koala)
Hello,

I'm trying to work something out with snmpset (Net-SNMP 5.5).
I have added this line to my snmpd.conf

rwcommunity  public localhost

And I did not set any restriction to the community 'public'.
Then I try to set a dummy string to it with this command:

snmpset -v 2c -c public localhost ucdDemoPublicString.0 s "Hello World"

It didn't work. The following message gets back to me:

Error in packet.
Reason: noAccess
Failed object: UCD-DEMO-MIB::ucdDemoPublicString.0

Did I missed anything in my setup?
How can I check what the problem is?
Any suggestion?

Please help.
Thanks.


Koala Yeung
--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d___
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


Re: Reg : snmpset problem in my model mib

2010-06-11 Thread Wes Hardaker
> On Thu, 10 Jun 2010 12:42:09 +0530, Thazhai Arasan 
>  said:

TA> I have created my own mib with READ-WRITE access. After that i create the
TA> template code & compiled it. Then i put it into my board. But only snmpget
TA> is working, snmpset is not working. I cant set the values through snmpset.
TA> In coding it is designed only for get option. How can i modify it for set
TA> option. Is there any memory issue or IOCTL problem will come?

Have you read the tutorials or the documentation on how to write agent
code?  Did you *only* create template code without modifying it? (if so,
that certainly won't work).
-- 
Wes Hardaker
Cobham Analytic Solutions

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
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


Reg : snmpset problem in my model mib

2010-06-10 Thread Thazhai Arasan
Hi,

   I have created my own mib with READ-WRITE access. After that i create the
template code & compiled it. Then i put it into my board. But only snmpget
is working, snmpset is not working. I cant set the values through snmpset.
In coding it is designed only for get option. How can i modify it for set
option. Is there any memory issue or IOCTL problem will come?

Regards,
Thazhaiarasan R.
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
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


RE: snmpset problem in windows

2010-02-16 Thread Mike Ayers

> From: Vivek Singh Bhadauria [mailto:viv_...@yahoo.com]
> Sent: Thursday, February 11, 2010 6:39 AM

> I am using Net-SNMP 5.4.2.1 for both Linux and Windows.
> In Linux, I am able to get/set the object values for my own enterprise
> mibs.
> But I face the problem in windows. I installed the same subagent
> application in windows using cygwin.
> 
> On Cygwin, snmpwalk and get commands are working but snmpset is not
> working fine.
> In some system it gives no response while on others it says that set is
> done but actually there is no value set.

Is this your own subagent?  Have you tried the same tests with standard 
MIBs?


Mike

--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
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


snmpset problem in windows

2010-02-11 Thread Vivek Singh Bhadauria
Hi,

I have just get one problem with my subagent for snmpset command.

I am using Net-SNMP 5.4.2.1 for both Linux and Windows.
In Linux, I am able to get/set the object values for my own enterprise mibs.
But I face the problem in windows. I installed the same subagent application in 
windows using cygwin.

On Cygwin, snmpwalk and get commands are working but snmpset is not working 
fine.
In some system it gives no response while on others it says that set is done 
but actually there is no value set.

Below are  the commands for Linux :
snmpwalk -On -v2c -c private localhost 
ONE97-ALARM-CONFIG-MIB::one97FilterdLogConfigTable
.1.3.6.1.4.1.33830.1.1.4.2.1.2.2 = STRING: "app"
.1.3.6.1.4.1.33830.1.1.4.2.1.2.6 = ""
.1.3.6.1.4.1.33830.1.1.4.2.1.3.2 = STRING: "app2"
.1.3.6.1.4.1.33830.1.1.4.2.1.3.6 = ""
.1.3.6.1.4.1.33830.1.1.4.2.1.4.2 = INTEGER: minor(5)
.1.3.6.1.4.1.33830.1.1.4.2.1.4.6 = INTEGER: critical(3)
.1.3.6.1.4.1.33830.1.1.4.2.1.5.2 = INTEGER: createAndWait(5)
.1.3.6.1.4.1.33830.1.1.4.2.1.5.6 = INTEGER: 0

snmpset -On -v2c -c private localhost .1.3.6.1.4.1.33830.1.1.4.2.1.3.2 s "app2"
.1.3.6.1.4.1.33830.1.1.4.2.1.3.2 = STRING: "app3"

snmpget -On -v2c -c private localhost .1.3.6.1.4.1.33830.1.1.4.2.1.3.2
.1.3.6.1.4.1.33830.1.1.4.2.1.3.2 = STRING: "app3"


Below are  the same commands for Cygwin :

snmpwalk -On -v2c -c private localhost 
ONE97-ALARM-CONFIG-MIB::one97FilterdLogConfigTable

.1.3.6.1.4.1.33830.1.1.4.2.1.2.2 = STRING: "app"

.1.3.6.1.4.1.33830.1.1.4.2.1.2.6 = ""

.1.3.6.1.4.1.33830.1.1.4.2.1.3.2 = STRING: "app2"

.1.3.6.1.4.1.33830.1.1.4.2.1.3.6 = ""

.1.3.6.1.4.1.33830.1.1.4.2.1.4.2 = INTEGER: minor(5)

.1.3.6.1.4.1.33830.1.1.4.2.1.4.6 = INTEGER: critical(3)

.1.3.6.1.4.1.33830.1.1.4.2.1.5.2 = INTEGER: createAndWait(5)

.1.3.6.1.4.1.33830.1.1.4.2.1.5.6 = INTEGER: 0



snmpset -On -v2c -c private localhost .1.3.6.1.4.1.33830.1.1.4.2.1.3.2 s "app4"

no response from localhost



snmpget -On -v2c -c private localhost .1.3.6.1.4.1.33830.1.1.4.2.1.3.2

.1.3.6.1.4.1.33830.1.1.4.2.1.3.2 = STRING: "app2"

Note:
On some Cygwin machine, I get the response on set command but actually it is 
not setting any values

snmpwalk -On -v2c -c private localhost 
ONE97-ALARM-CONFIG-MIB::one97FilterdLogConfigTable


.1.3.6.1.4.1.33830.1.1.4.2.1.2.2 = STRING: "app"


.1.3.6.1.4.1.33830.1.1.4.2.1.2.6 = ""


.1.3.6.1.4.1.33830.1.1.4.2.1.3.2 = STRING: "app2"


.1.3.6.1.4.1.33830.1.1.4.2.1.3.6 = ""


.1.3.6.1.4.1.33830.1.1.4.2.1.4.2 = INTEGER: minor(5)


.1.3.6.1.4.1.33830.1.1.4.2.1.4.6 = INTEGER: critical(3)


.1.3.6.1.4.1.33830.1.1.4.2.1.5.2 = INTEGER: createAndWait(5)


.1.3.6.1.4.1.33830.1.1.4.2.1.5.6 = INTEGER: 0





snmpset -On -v2c -c private localhost .1.3.6.1.4.1.33830.1.1.4.2.1.3.2 s "app5"


.1.3.6.1.4.1.33830.1.1.4.2.1.3.2 = STRING: "app5"





snmpget -On -v2c -c private localhost .1.3.6.1.4.1.33830.1.1.4.2.1.3.2


.1.3.6.1.4.1.33830.1.1.4.2.1.3.2 = STRING: "app2"



Any suggestions why it is behaving like this??





  The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo.com/--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev___
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


snmpset problem

2009-04-13 Thread Vinod Nanjaiah
Hi,
I am trying snmpset for a table. I have added a member of type RowStatus in the 
MIB file and set this to CreateAndGo (4) when using snmpset.
But I am still unable to add new rows to the table.

I get the following error:
Error in packet.
Reason: notWritable (That object does not support modification)
Failed object: VPN-GRP::vpnIndex.15

I have commented out "if(1)" in xxx_validate_index ().
Any pointers on what could be wrong, why I am unable to add new rows?

Thank you!
Vinod





http://www.mindtree.com/email/disclaimer.html
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-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


SNMPSET Problem

2006-03-21 Thread V M Gadag




Hi,

check for the following,

1) MIB object which you want to set should be writable.
2) you need to add "rwcommunity private default " to the snmpd.conf file as the MIB object you are trying to set is under a private section. or else you can specifically make only that MIB  as writable.

Regards,
Gadag



---DISCLAIMER--
The information transmitted herewith is confidential and proprietary information intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
---




SNMPSET Problem

2006-03-20 Thread Vishakha Sharma
Hi
I want to perform snmpset on the mib i added .I gave the following command
[EMAIL PROTECTED] bin]# ./snmpget -c public 10.9.10.195
.1.3.6.1.4.1.272.4.8.1
2.0
SNMPv2-SMI::enterprises.272.4.8.1.2.0 = INTEGER: 2

I tried changing the value of the variable  thru following command
[EMAIL PROTECTED] bin]# ./snmpset -c public 10.9.10.195
.1.3.6.1.4.1.272.4.8.1
2.0 i 3
Error in packet.
Reason: notWritable (That object does not support modification)


Also i tried setting syslocation and sysDescr also but it is giving the same
error .What changes i have to do for making a variable writable .
And also please tell me the changes that need to be done in snmpd.conf file
.

Please help me out regarding this .

Thanks in advance
Vishakha

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s)and may 
contain confidential or privileged information. If you are not the intended 
recipient, please notify the sender or [EMAIL PROTECTED]


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
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


SNMPSET problem

2005-03-10 Thread Haizhu Liu
I am having a problem with snmpset:
this is what I coded to add an integer to snmp set pdu:
int action = 2;
char type= 'i';
string action_str((char *)&action, sizeof(action));

pdu = snmp_pdu_create(SNMP_MSG_SET);
int rc = snmp_add_var(pdu, myoid, sizeof(myoid)/sizeof(oid), type, 
action_str.data());

I made sure myoid is a valid oid.
I got failure from snmp_add_var, anybody have suggestions?

---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
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