Re: string as index of a table

2014-10-17 Thread Fulko Hew
On Fri, Oct 17, 2014 at 10:38 AM, sarath azad 
wrote:

> Hi Niels,
>
> But using a query like:  snmpwalk $host   table>.1..\"ABCDE\"
> is not working also. Below are the test results :
>
>  snmpget $host   table>.1..10."66.67.68.69.70.71.72.73.74.75"
>  .1.."BCDEFGHIJK" = INTEGER: 0
> snmpget $host  .1..10.\"ABCDEFGHIJ\"
>  .1..10."ABCDEFGHIJ": Unknown Object Identifier
> (Index out of range: "ABCDEFGHIJ")
> snmpget $host  .1..10.'ABCDEFGHIJ'
>  .1..10.ABCDEFGHIJ: Unknown Object Identifier (Index
> out of range: ABCDEFGHIJ )
>
> Could you please help in resolving this?
>

You don't need to insert the length explicitly, it will be calculated and
inserted for you.
Try:

snmpget $host  .1..\"ABCDEFGHIJ\"
--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: string as index of a table

2014-10-17 Thread sarath azad
Hi Niels,
 
But using a query like:  snmpwalk $host  .1..\"ABCDE\" 
is not working also. Below are the test
results :
 
 snmpget $host 
.1..10."66.67.68.69.70.71.72.73.74.75"
 .1.."BCDEFGHIJK" = INTEGER: 0
snmpget $host  .1..10.\"ABCDEFGHIJ\"
 .1..10."ABCDEFGHIJ": Unknown Object Identifier
(Index out of range: "ABCDEFGHIJ")
snmpget $host  .1..10.'ABCDEFGHIJ'
 .1..10.ABCDEFGHIJ: Unknown Object Identifier (Index out
of range: ABCDEFGHIJ )
 
Could you please help in resolving this? 
 
Thanks and regards
S Sarath 



On Thursday, October 16, 2014 10:00 PM, Niels Baggesen 
 wrote:
 


On Thu, Oct 16, 2014 at 11:04:54PM +0800, sarath azad wrote:

> I have tested it, it is feasible, but while giving the OID in snmpget,
> we needed to give the item name string index by dot separated ascii
> values of each character in the name. 
> eg.  .1. no.>.5."65.66.67.68.69"  where the item name is "ABCDE". 

I wonder where this is documented :-(

If you make sure that the shell passes the quotes to the command, you
can actually do it:

snmpwalk $host  .1..\"ABCDE\"

If the index is an IMPLIED string (one without a length prefix) you must
use single quotes in stead of double quotes.

See the -OE option to snmpcmd(1)

/Niels

-- 
Niels Baggesen - @home - Århus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: string as index of a table

2014-10-16 Thread Joel Hansell
Hi,

I've seen this technique used by a major telecom vendor, so it's certainly
technically doable. They included DateAndTime and a name string as part of
the index on trap varbinds.
I would advise you to find a different way, though, just for the reasons
you mention. It's not human-readable at all, and while our NMS system
calculates the corect OID values by a script, it took time to develop and
it was hell to work with when integration testing.

Maybe you could keep the strings as row values in another table, and use a
shared numeric index for the two tables, to map them together?

BR,
Joel Hansell

On Thu, Oct 16, 2014 at 5:04 PM, sarath azad  wrote:

> Hello,
>
> Could you please if it is advisable to use a string eg. name of item as a
> table index?
> The table is yet to be defined, need defined and added to a MIB file.
> The table will contain info of different items and our requirement is if
> we can get the info of a particular item by doing snmpget query passing the
> item name string as index.
> I have tested it, it is feasible, but while giving the OID in snmpget, we
> needed to give the item name string index by dot separated ascii values of
> each character in the name.
> eg.  .1..5."65.66.67.68.69"  where the item
> name is "ABCDE".
>
> But from usage perspective it is not looking good that we need to manually
> calculate the ascii values of the characters in the item name and provide
> them in the snmpget query.
> Is there any other way of doing this so that we can directly give the item
> name and not the ascii values?
> Some thing like:  .1..5."ABCD" or  the table> .1..5."A.B.C.D"
>
> thanks and regards
> S Sarath
>
>
>
> --
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> ___
> Net-snmp-coders mailing list
> Net-snmp-coders@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>
>
--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: string as index of a table

2014-10-16 Thread Niels Baggesen
On Thu, Oct 16, 2014 at 11:04:54PM +0800, sarath azad wrote:
> I have tested it, it is feasible, but while giving the OID in snmpget,
> we needed to give the item name string index by dot separated ascii
> values of each character in the name. 
> eg.  .1. no.>.5."65.66.67.68.69"  where the item name is "ABCDE". 

I wonder where this is documented :-(

If you make sure that the shell passes the quotes to the command, you
can actually do it:

snmpwalk $host  .1..\"ABCDE\"

If the index is an IMPLIED string (one without a length prefix) you must
use single quotes in stead of double quotes.

See the -OE option to snmpcmd(1)

/Niels

-- 
Niels Baggesen - @home - Århus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


string as index of a table

2014-10-16 Thread sarath azad
Hello,

Could you please if it is advisable to use a string eg. name of item as a table 
index? 
The table is yet to be defined, need defined and added to a MIB file.
The table will contain info of different items and our requirement is if we can 
get the info of a particular item by doing snmpget query passing the item name 
string as index. 
I have tested it, it is feasible, but while giving the OID in snmpget, we 
needed to give the item name string index by dot separated ascii values of each 
character in the name. 
eg.  .1..5."65.66.67.68.69"  where the item name is "ABCDE". 

But from usage perspective it is not looking good that we need to manually 
calculate the ascii values of the characters in the item name and provide them 
in the snmpget query.
Is there any other way of doing this so that we can directly give the item name 
and not the ascii values?
Some thing like:  .1..5."ABCD" or  .1..5."A.B.C.D"

thanks and regards
S Sarath--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders