snmpset with type 'a' [message #175360] |
Sun, 11 September 2011 19:33 |
shija03
Messages: 2 Registered: September 2011
Karma: 0
|
Junior Member |
|
|
I am trying to do an snmpset with type 'a' IPADDRESS, I can't find any
examples out there on how to do this. I am on a Windows System and I
have even tried to do inet_pton($ip_str) to convert the string IP
address to inet_addr and pass it to snmpset, but in windows it says
that inet_pton is not a recognized function.
I have tried doing the snmpset using string type - this does not work,
or unsigned integor and converting the IP address to long, obviously
this doesn't work either. Passing a string to type 'a':
snmpset(host, communitystring, 'a', '10.10.10.10')
does not work either - I get the value given has the wrong type or
length.
Any help would be great - and in this rare case, the php.net
documentation does not help at all.
|
|
|
Re: snmpset with type 'a' [message #175362 is a reply to message #175360] |
Sun, 11 September 2011 20:03 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 9/11/2011 3:33 PM, shija03 wrote:
> I am trying to do an snmpset with type 'a' IPADDRESS, I can't find any
> examples out there on how to do this. I am on a Windows System and I
> have even tried to do inet_pton($ip_str) to convert the string IP
> address to inet_addr and pass it to snmpset, but in windows it says
> that inet_pton is not a recognized function.
>
> I have tried doing the snmpset using string type - this does not work,
> or unsigned integor and converting the IP address to long, obviously
> this doesn't work either. Passing a string to type 'a':
>
> snmpset(host, communitystring, 'a', '10.10.10.10')
>
> does not work either - I get the value given has the wrong type or
> length.
>
> Any help would be great - and in this rare case, the php.net
> documentation does not help at all.
>
You must be running an old version of PHP. It's available on Windows as
of PHP 5.3 (which has been out for almost 2 years).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: snmpset with type 'a' [message #175368 is a reply to message #175362] |
Mon, 12 September 2011 11:38 |
shija03
Messages: 2 Registered: September 2011
Karma: 0
|
Junior Member |
|
|
I am running 5.2.17 - but the question is not about inet_pton(...) but
rather about how do you use snmpset with a type of 'a' (IPADDRES).
If I run:
snmpset( '172.101.110.11', 'someprivatecomm' , $oid.'2' , 'a',
'172.100.100.101')
I get an error: "The value given has the wrong type of length"
Can someone show me how to do snmpset for an IPADDRESS type?
On Sep 11, 4:03 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 9/11/2011 3:33 PM, shija03 wrote:
>
>
>
>
>
>> I am trying to do an snmpset with type 'a' IPADDRESS, I can't find any
>> examples out there on how to do this. I am on a Windows System and I
>> have even tried to do inet_pton($ip_str) to convert the string IP
>> address to inet_addr and pass it to snmpset, but in windows it says
>> that inet_pton is not a recognized function.
>
>> I have tried doing the snmpset using string type - this does not work,
>> or unsigned integor and converting the IP address to long, obviously
>> this doesn't work either. Passing a string to type 'a':
>
>> snmpset(host, communitystring, 'a', '10.10.10.10')
>
>> does not work either - I get the value given has the wrong type or
>> length.
>
>> Any help would be great - and in this rare case, the php.net
>> documentation does not help at all.
>
> You must be running an old version of PHP. It's available on Windows as
> of PHP 5.3 (which has been out for almost 2 years).
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================- Hide quoted text -
>
> - Show quoted text -
|
|
|
Re: snmpset with type 'a' [message #175370 is a reply to message #175360] |
Mon, 12 September 2011 12:47 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 9/11/2011 3:33 PM, shija03 wrote:
> I am trying to do an snmpset with type 'a' IPADDRESS, I can't find any
> examples out there on how to do this. I am on a Windows System and I
> have even tried to do inet_pton($ip_str) to convert the string IP
> address to inet_addr and pass it to snmpset, but in windows it says
> that inet_pton is not a recognized function.
>
> I have tried doing the snmpset using string type - this does not work,
> or unsigned integor and converting the IP address to long, obviously
> this doesn't work either. Passing a string to type 'a':
>
> snmpset(host, communitystring, 'a', '10.10.10.10')
>
> does not work either - I get the value given has the wrong type or
> length.
>
> Any help would be great - and in this rare case, the php.net
> documentation does not help at all.
>
No, there's not a lot of documentation on it because it's a low level
command and completely dependent on the remote system - which objects
exist and what the members of those objects are.
I've never used this particular function in PHP, but looking at the doc:
bool snmpset ( string $hostname , string $community , string $object_id
, string $type , mixed $value [, int $timeout [, int $retries ]] )
It looks like you're missing a value - maybe $object_id?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|