Невозможно убить процессы через SNMP

Я пытаюсь убить процессы с помощью SNMP. Я знаю, что возможно установить значение 4 в поле «статус» процесса, например:

snmpset -v 2c -c community_string ipaddress 1.3.6.1.2.1.25.4.2.1.7.PID i 4

Я всегда получаю одно и то же сообщение:

Ошибка в пакете. Причина: не доступен для записи (этот объект не поддерживает модификацию) Неудачный объект: iso.3.6.1.2.1.25.4.2.1.7.PID

Я не знаю почему, но это также происходит, когда я использую «локальный хост», который обычно имеет все привилегии. Может у меня что-то не так в настройках? Это мой файл snmpd.conf:

#  AGENT BEHAVIOUR
#

#  Listen for connections from the local system only
agentAddress  udp:161
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
#agentAddress udp:161,udp6:[::1]:161

###############################################################################
#
#  ACCESS CONTROL
#

                                                 #  system + hrSystem groups only
view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1

                                                 #  Full access from the local host
rwcommunity public  localhost

rwcommunity ubuntulaptop
                                                 #  Default access to basic system info
 rocommunity public  default    -V systemonly
                                                 #  rocommunity6 is for IPv6
 rocommunity6 public  default   -V systemonly

                                                 #  Full access from an example network
                                                 #     Adjust this network address to match your local
                                                 #     settings, change the community string,
                                                 #     and check the 'agentAddress' setting above
#rocommunity secret  10.0.0.0/16

                                                 #  Full read-only access for SNMPv3
 rouser   authOnlyUser
                                                 #  Full write access for encrypted requests
                                                 #     Remember to activate the 'createUser' lines above
#rwuser   authPrivUser   priv

#  It's no longer typically necessary to use the full 'com2sec/group/access' configuration
#  r[ow]user and r[ow]community, together with suitable views, should cover most requirements



###############################################################################
#
#  SYSTEM INFORMATION
#

#  Note that setting these values here, results in the corresponding MIB objects being 'read-only'
#  See snmpd.conf(5) for more details
sysLocation    Sitting on the Dock of the Bay
sysContact     Me <[email protected]>
                                                 # Application + End-to-End layers
sysServices    72


#
#  Process Monitoring
#
                               # At least one  'mountd' process
proc  mountd
                               # No more than 4 'ntalkd' processes - 0 is OK
proc  ntalkd    4
                               # At least one 'sendmail' process, but no more than 10
proc  sendmail 10 1

#  Walk the UCD-SNMP-MIB::prTable to see the resulting output
#  Note that this table will be empty if there are no "proc" entries in the snmpd.conf file


#
#  Disk Monitoring
#
                               # 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk       /     10000
disk       /var  5%
includeAllDisks  10%

#  Walk the UCD-SNMP-MIB::dskTable to see the resulting output
#  Note that this table will be empty if there are no "disk" entries in the snmpd.conf file


#
#  System Load
#
                               # Unacceptable 1-, 5-, and 15-minute load averages
load   12 10 5

#  Walk the UCD-SNMP-MIB::laTable to see the resulting output
#  Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file


person Simone Petrosino    schedule 20.05.2016    source источник


Ответы (1)


Ошибка в пакете. Причина: не доступен для записи (этот объект не поддерживает> модификацию) Неудачный объект: iso.3.6.1.2.1.25.4.2.1.7.PID

Это сообщение выше, вероятно, именно то, что он говорит. Переменная доступна только для чтения и не может быть изменена. Доступна ли переменная для записи или нет, указано в MIB. Лучше сначала проверить MIB. Если переменная доступна только для чтения, не имеет значения, что вы делаете.

Убивать процессы с помощью SNMP, насколько я знаю, не так уж и часто. По крайней мере, вы обычно не делаете это таким образом. SNMP предназначен для управления сетью. Но опять же, если у вас есть проприетарная MIB, вы должны проверить ее и посмотреть, что там написано.

person Ola    schedule 06.06.2016