Computer Scientist

Thursday, 2 December 2010

Problems suffered when I was usign SNMP

1. Set user pass-phrases problem:
    It seems to be infeasible to change pass-phrases directly in configure file. Each time, after I changed pass-phrases in configure file, I can still not make it effect even I have already restart the snmpd.
    (1). When I used snmpusm command to change password, I got a error message. This is because I was failed to assign a correct view to my current account.
    (2). When I used the same command, I got a USM generic error in rpc242. I supposed that I used wrong syntax of snmpusm command. Here is this time's typing (running locally in rpc242):
  snmpusm -v3 -l authPriv -u chenfu -a MD5 -A -x DES -X localhost passwd [ -Ca | -Cx ]

2. Running External Program:
    Actually, I can use several different "things" to run external programs using snmp on remote host.
    (1). "sh" is used to run shell script specially.
    (2). "exec" can used to run almost all of programs. <>
    ========Both "sh" and "exec" should be used by occasions when only one line result is needed. They are under a specific OID. Before, it seems to be feasible to assign aa arbitrary OID to a specific program (It is your responsibility to make sure no conflicts happen.). But now, I have never completed it. Maybe new version of SNMP forbidden this unreliable feature.========
    (3). "extend" is emerge under the situation where the manually assigning of an OID to a program is unsupported by "sh" and "exec".
    (4). "pass" is used to deal with some manually assigned OID. I am not quite familiar with "pass". As far as I know, you are able to decide what operations to do when a specific OID is looked up.

    My problem at the beginning is that I accidentally used the "exec" to run a simple script. I want to use a manually assigned OID to mark this entry. But it failed. When I turned to use "extend", it works quite well.

3. Usage of extend without assigned OID:

  1. On the remote server configure date extension in /etc/snmp/snmpd.conf. Simply add this single line at the end of the config file and reload snmpd:
    extend datecheck /bin/date
    
  2. From any client that has allowed SNMP access to the server query the datecheck with:
    ~$ snmpwalk -v2c -c public remote.server NET-SNMP-EXTEND-MIB::nsExtendOutputFull
    NET-SNMP-EXTEND-MIB::nsExtendOutputFull."datecheck" = STRING: Wed Oct 18 00:01:44 NZDT 2006
    
    That's about it. Easy way to run programs and scripts remotely, isn't it?

No comments:

Post a Comment