rfc1856.txt

来自「RFC 的详细文档!」· 文本 代码 · 共 956 行 · 第 1/3 页

TXT
956
字号

    >LOGIN "mule" "skey"
    <CHAL "78 lo39065"
    >AUTH "COW DOG FRED LOG COLD WAR"
    <110 "Login invalid"

   The server should have some type of logging mechanism to record  both
   successful  and unsuccessful login attempts for a system adminstrator
   to peruse.









Clark                        Informational                      [Page 6]

RFC 1856               Opstat Client-Server Model           October 1995


3.3  The EXIT Command

   The EXIT command disconnects a current user from the server.  The
   format of the EXIT command is:

   EXIT

   Note that upon reception of an EXIT command, the server must always
   close the connection, even if it would be appropriate to return an
   ERROR return code.

    A sample EXIT command:

    >EXIT
    <990 "OK, Bye now"

3.4  The SELECT Command

   The SELECT command is the function used to tag data for retrieval
   from the server.  The SELECT command has the format:

    SELECT-COM   ::=  SELECT <NETWORK> <DEVICE> <INTERFACE> <VARNAME>
                      <GRANULARITY> <START-DATE> <START-TIME> <END-DATE>
                      <END-TIME> <AGG> <SELECT-COND>

    NETWORK      ::=  <ASCII-STRING>

    DEVICE       ::=  <ASCII-STRING>
    INTERFACE    ::=  <ASCII-STRING>
    VARNAME      ::=  <ASCII-STRING>
    GRANULARITY  ::=  <ASCII-STRING>
    START-DATE   ::=  <DATE-TYPE>
    END-DATE     ::=  <DATE-TYPE>
    DATE-TYPE    ::=  YYYY-MM-YY
    START-TIME   ::=  <TIME-TYPE>
    END-TIME     ::=  <TIME-TYPE>
    TIME-TYPE    ::=  HH:MM:SS
    AGG          ::=  <AGG-TYPE> | NULL
    AGG-TYPE     ::=  TOTAL | PEAK
    SELECT-COND  ::=  <SELECT-STMT> | NULL
    SELECT-STMT  ::=  WITH DATA <COND-TYPE> <ASCII-STRING>
    COND-TYPE    ::=  LE | GE | EQ | NE | LT | GT

   If any conditional within the SELECT does not match existing data
   within the database (such as VARNAME, the S-DATE or E-DATE, or
   GRANULARITY), the server must return an ERROR (and hopefully a
   meaningful error message).  The time values must be specified in GMT,
   and hours are specified in the range from 0-23.  The granularity



Clark                        Informational                      [Page 7]

RFC 1856               Opstat Client-Server Model           October 1995


   should always be specified in seconds. A sample query might be:

      SELECT net rtr1 eth-0 ifInOctets 900 1992-01-01 00:00:00 1992-02-
      01 23:59:59

   which would select all data from network "net" device "rtr1"
   interface "eth-0" from Jan 1, 1992 @ 00:00:00 to Feb 1, 1992 @
   23:59:59.

   Note that if the client requests some type of aggregation to be
   performed upon the data, then the aggregation field specifies how to
   perform the aggregration (i.e., total or peak) and the granularity
   specifies to what interval (in seconds) to agggregate the data to.
   For more details about the granularity types, see [1].  If the server
   cannot perform the requested action, then it must return a 120 error.
   The server may, if it wishes, use other error codes in the range
   121-129 to convey more information about the specific error that
   occured.  In either case, its recommended that the server return
   ASCII text describing the error.

   Upon completion of the data lookup, the SELECT must return the an
   indication of whether the lookup was successful and (if the search
   was successful) the tag associated with that data.  If the lookup was
   successful, then information in the return code should be encoded as:

    920 " TAG <ASCII-STRING> "

   In this case, the use of the word TAG is used as a handle for the
   selected data on the server.  Note that this single handle may refer
   to one or more specific SNMP variables (refer to [1] for a further
   explanation).

   For example, if the tag "foobar" were assigned to the select example
   above, then the OK would be as:

    920 "TAG foobar"

   It is recommended that the return tag string be less than 10 bytes
   long (this gives many tag combinations), although the server (and
   client) should be capable of handling arbitrary length strings.
   There is no requirement that the TAG have any particular meaning and
   may be composed of arbitrary strings.

   The server must keep any internal information it needs during a
   session so that all SELECT tags can be processed by GET or other
   commands.  If a server doesn't have the resources to process the
   given SELECT, it must return an error message.




Clark                        Informational                      [Page 8]

RFC 1856               Opstat Client-Server Model           October 1995


   It is the responsibility of the client to store information about the
   data that a particular tag corresponds to, i.e., if the server had
   returned a tag "1234" for ifInOctet data for October 1993, then the
   client must store that information someplace as the variables which
   correspond to that tag cannot be retrieved from the server.

3.5  The STATUS Command

   The STATUS command shows the general state of the server plus listing
   all data sets which have been tagged via the SELECT command.  The
   STATUS command has no arguments.  The output from a STATUS command
   is:

    STATUS-DATA      ::=  <SERVER-STATUS> <SERVER-TAG-LIST>
    SERVER-STATUS    ::=  "STATUS= " <STATUS-FIELDS>
    STATUS-FIELDS    ::=  "OK" | "NOT-OK"
    SERVER-TAG-LIST  ::=  <SERVER-TAG> | NULL
    SERVER-TAG       ::=  "TAG" <TAG-ID> "SIZE" <NUMBER>

   The number returned in the SIZE field represents the number of octets
   of data represented by the particular TAG.  The server must return a
   931 message before the STATUS output starts, and a 932 message at the
   end of the STATUS output.  If any type of failure occurs, then a 130
   error messages must be sent.  If the server prefers, it may send a
   message in the range of 131-139 if it wishes, but its recommended
   that the server always return ASCII describing the enoutered error.
   For example, a sample output might look like:

    >STATUS
    <931 "STATUS Command Starting"
    <STATUS= OK
    <TAG 1234 SIZE 123456
    <TAG ABCD SIZE 654321
    <932 "STATUS Command successful"

    or

    >STATUS
    <130 "Can't get STATUS right now, sorry."

    or

    >STATUS
    <931 "STATUS Command Starting"
    <STATUS= OK
    <TAG 1234 SIZE 1
    <131 "Oops, error reading TAG table, sorry."




Clark                        Informational                      [Page 9]

RFC 1856               Opstat Client-Server Model           October 1995


 3.6  The GET Command

   The GET command actually retrieves the data chosen via a previous
   SELECT command.  The GET command has the format:

    GET-CMD  ::=  GET <TAG> <TYPE>
    TAG      ::=  <ASCII-STRING>
    TYPE     ::=  1404 | <ASCII-STRING>

   If the TAG matches a previously returned TAG from a SELECT statement,
   then the previously tagged data is returned.  If the TAG is invalid
   (i.e., it hasn't been previously assigned by the server), then the
   server must return an error.  The TYPE specifies the encoding of the
   data stream.  All servers must support "1404" encoding.  Others forms
   may be supported as desired.

   If the server, while retrieving the data, cannot retrieve some
   portion of the data (i.e., some of the data previously found
   disappeared between the time of the SELECT and the time of the GET),
   then the server must return a 150 error.  If the client requests an
   encoding type not supported by the server, then the server must
   return a 151 error.

   The format of the returned data is as follows:

    RETURN-DATA-TYPE   ::=   START-DATA  <RETURN-TYPE>  <DATA>   END-DATA
    RETURN-TYPE       ::=  1404 | <ASCII-STRING>

    An example would be:

    >GET ABC 1404
    <951 "OK, here it comes!"
    <START-DATA 1404

    1404 data stream here...

    <END-DATA
    <952 "All done!"

    Error examples:

    >GET ABC STRONG-CRYPT
    <151 "Sorry, that encoding not available here"

    or

    >GET ABC 1404
    <951 "OK, here it comes!"



Clark                        Informational                     [Page 10]

RFC 1856               Opstat Client-Server Model           October 1995


    <START-DATA 1404

    1404 data stream here...

    <END-DATA
    <150 "Whoa, bad data..."

   If any type of error code is returned by the server, the client must
   discard all data received from the server.

3.7  The LIST Command

   The LIST command allows the client to query the server about
   available data residing on the server.  The LIST command has the
   format:

    LIST-CMD  ::=  LIST <net> <dev> <intf> <var> <gran> <sdate> <stime>
                   <edate> <etime>
    <net>     ::=  <ASCII-STRING> | *
    <dev>     ::=  <ASCII-STRING> | *
    <intf>    ::=  <ASCII-STRING> | *
    <var>     ::=  <ASCII-STRING> | *
    <gran>    ::=  <ASCII-STRING> | *
    <sdate>   ::=  <DATE-TYPE>    | *
    <edate>   ::=  <DATE-TYPE>    | *
    <stime>   ::=  <TIME-TYPE>    | *
    <etime>   ::=  <TIME-TYPE>    | *

   For example, to get a list of networks that the server has data for,
   you would use the command:

    LIST * * * * * * * * *

    The command

    LIST netx rtry * * * * * * *

    will list all interfaces for rtry.  The command

    LIST netx rtry * ifInOctets * 1993-02-01 * * *

   will get the list of interfaces on device "rtry" in network "netx"
   which have values for the variable "ifInOctets" after the start date
   of Februrary 1, 1993.







Clark                        Informational                     [Page 11]

RFC 1856               Opstat Client-Server Model           October 1995


   To process wildcards in a LIST command, follow these rules:

    1)  Only the leftmost wildcard will be serviced for a given
        LIST command
    2)  If all fields to the right of the leftmost wildcard are
        wildcards, then all values for the wildcard being processed
        will be returned.
    3)  If specific values are given for fields to the right of the
        wildcard being serviced, then the specific values must match
        a known value

   The output from the LIST command is formatted as follows:

    LIST-RETURN  ::=  START-LIST <LIST-ENTRY> END-LIST
    LIST-ENTRY   ::=  <net> <device> <intf> <var> <gran> <sdate> <stime>
                      <edate> <etime>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?