SNMP é–ĸ数

į›ŽæŦĄ

  • snmp_get_quick_print — NET-SNMP ナイブナãƒĒぎ quick_print ãŽįžåœ¨ãŽč¨­åŽšå€¤ã‚’å–åž—ã™ã‚‹
  • snmp_get_valueretrieval — SNMP ぎ値がčŋ”ã•ã‚Œã‚‹æ–šæŗ•ã‚’čŋ”す
  • snmp_read_mib — ã‚ĸã‚¯ãƒ†ã‚Ŗãƒ–ãĒ MIB ツãƒĒãƒŧぎ中ãĢ MIB ãƒ•ã‚Ąã‚¤ãƒĢをčĒ­ãŋčžŧんでパãƒŧ゚する
  • snmp_set_enum_print — すずãĻぎ enum を、原際ぎ整数値ではãĒく enum 値とともãĢčŋ”す
  • snmp_set_oid_numeric_print — snmp_set_oid_output_format ぎエイãƒĒã‚ĸ゚
  • snmp_set_oid_output_format — OID ぎå‡ē力åŊĸåŧã‚’č¨­åŽšã™ã‚‹
  • snmp_set_quick_print — NET-SNMP ナイブナãƒĒで enable ãŽå€¤ã‚’č¨­åŽšã™ã‚‹
  • snmp_set_valueretrieval — SNMP ぎ値がčŋ”ã•ã‚Œã‚‹æ–šæŗ•ã‚’č¨­åŽšã™ã‚‹
  • snmp2_get — SNMP ã‚Ēブジェクトを取垗する
  • snmp2_getnext — 指厚したã‚Ēブジェクト ID ãĢįļšã SNMP ã‚Ēブジェクトを取垗する
  • snmp2_real_walk — 指厚したすずãĻぎã‚Ēブジェクトとそぎã‚Ēブジェクト ID をčŋ”す
  • snmp2_set — SNMP ã‚Ēãƒ–ã‚¸ã‚§ã‚¯ãƒˆãŽå€¤ã‚’č¨­åŽšã™ã‚‹
  • snmp2_walk — すずãĻぎ SNMP ã‚Ēブジェクトをエãƒŧã‚¸ã‚§ãƒŗãƒˆã‹ã‚‰å–åž—ã™ã‚‹
  • snmp3_get — SNMP ã‚Ēブジェクトを取垗する
  • snmp3_getnext — 指厚したã‚Ēブジェクト ID ãĢįļšã SNMP ã‚Ēブジェクトを取垗する
  • snmp3_real_walk — 指厚したすずãĻぎã‚Ēブジェクトとそぎã‚Ēブジェクト ID をčŋ”す
  • snmp3_set — SNMP ã‚Ēãƒ–ã‚¸ã‚§ã‚¯ãƒˆãŽå€¤ã‚’č¨­åŽšã™ã‚‹
  • snmp3_walk — すずãĻぎ SNMP ã‚Ēブジェクトをエãƒŧã‚¸ã‚§ãƒŗãƒˆã‹ã‚‰å–åž—ã™ã‚‹
  • snmpget — SNMP ã‚Ēブジェクトを取垗する
  • snmpgetnext — 指厚したã‚Ēブジェクト ID ãĢįļšã SNMP ã‚Ēブジェクトを取垗する
  • snmprealwalk — 指厚したã‚ĒブジェクトãĢé–ĸするã‚Ēブジェクト ID をåĢむすずãĻぎã‚Ēブジェクトをčŋ”す
  • snmpset — SNMP ã‚Ēãƒ–ã‚¸ã‚§ã‚¯ãƒˆãŽå€¤ã‚’č¨­åŽšã™ã‚‹
  • snmpwalk — エãƒŧã‚¸ã‚§ãƒŗãƒˆã‹ã‚‰å…¨ãĻぎ SNMP ã‚Ēブジェクトを取垗する
  • snmpwalkoid — ネットワãƒŧã‚¯ã‚¨ãƒŗãƒ†ã‚Ŗãƒ†ã‚ŖãĢé–ĸã™ã‚‹æƒ…å ąãƒ„ãƒĒãƒŧを検į´ĸする
īŧ‹add a note

User Contributed Notes 2 notes

up
7
1413 at blargh dot com Âļ
20 years ago
For my purposes in PHP coding, I have the following SNMP options set, always.  These aren't documented very well in PHP's docs, but they make dealing with the SNMP results a LOT easier:

<?php
// Return back the numeric OIDs, instead of text strings.
snmp_set_oid_numeric_print(1);

// Get just the values.
snmp_set_quick_print(TRUE);

// For sequence types, return just the numbers, not the string and numbers.
snmp_set_enum_print(TRUE); 

// Don't let the SNMP library get cute with value interpretation.  This makes 
// MAC addresses return the 6 binary bytes, timeticks to return just the integer
// value, and some other things.
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);  
?>
up
-1
Chris Âļ
18 years ago
Here's a fresh list of API for SNMPv1, SNMPv2c, and SNMPv3 as of PHP 5.2.4:

SNMPv1
------
string snmpget(string host, string community, string object_id [, int timeout [, int retries]]);

string snmpgetnext(string host, string community, string object_id [, int timeout [, int retries]]);

array snmpwalk(string host, string community, string object_id [, int timeout [, int retries]]);

array snmprealwalk(string host, string community, string object_id [, int timeout [, int retries]]);

bool snmp_get_quick_print(void);

void snmp_set_quick_print(int quick_print);

void snmp_set_enum_print(int enum_print);

void snmp_set_oid_output_format(int oid_format);

int snmpset(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]]);

SNMPv2c
-------
string snmp2_get(string host, string community, string object_id [, int timeout [, int retries]]);

string snmp2_getnext(string host, string community, string object_id [, int timeout [, int retries]]);

array snmp2_walk(string host, string community, string object_id [, int timeout [, int retries]]);

array snmp2_real_walk(string host, string community, string object_id [, int timeout [, int retries]]);

int snmp2_set(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]]);

SNMPv3
------
int snmp3_get(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]]);

int snmp3_getnext(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]]);

int snmp3_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]]);

int snmp3_real_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]]);

int snmp3_set(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id, string type, mixed value [, int timeout [, int retries]]);

General
-------
int snmp_set_valueretrieval(int method);

int snmp_get_valueretrieval();

int snmp_read_mib(string filename);

SNMPv3 options
--------------
SNMPv3 offers a different authentication/authorization scheme than previous versions of SNMP.  To aid in using the API listed above, here is a brief explanation of each of the unique parameters used in the snmp3_* functions.

$sec_name - the "username" used for authentication to the system

$sec_level - the authentication scheme ('noAuthNoPriv', 'authNoPriv', or 'authPriv')

$auth_protocol - the encryption protocol used for authentication ('MD5' [default] or 'SHA')

$auth_passphrase - the encrypted key to use as the authentication challenge

$priv_protocol - the encryption protocol used for protecting the protocol data unit ('DES' [default], 'AES128', 'AES192', or 'AES256')

$priv_passphrase - the key to use for encrypting the protocol data unit

There are good code snippets available on http://forums.cacti.net/about5403.html for more information.