snmpd 在 centos 6 中不起作用

snmpd 在 centos 6 中不起作用

我有 centos 6.4 64 位。snmpd 无法正常工作:当我重新启动时,我收到以下信息

Nov 18 12:43:31 hector kernel: CIFS VFS: No task to wake, unknown frame received! NumMids 58
Nov 18 12:43:31 hector kernel: CIFS VFS: No task to wake, unknown frame received! NumMids 58
Nov 18 12:43:31 hector kernel: netlink: 12 bytes leftover after parsing attributes.
Nov 18 12:43:31 hector snmpd[16487]: mibII/mta_sendmail.c:open_sendmailst: could not guess version of statistics file "/var/log/mail/statistics"
Nov 18 12:43:31 hector snmpd[16489]: NET-SNMP version 5.5

输出

[root@hector ~]# /usr/sbin/snmpd -Dmib_init -I -mta_sendmail -H 
No log handling enabled - turning on stderr logging
registered debug token mib_init, 1
mib_init: initializing: smux
mib_init: initializing: usmConf
mib_init: initializing: iquery
mib_init: initializing: vacm_conf
mib_init: initializing: diskio
mib_init: skipping:     mta_sendmail
mib_init: initializing: ipAddressPrefixTable
mib_init: initializing: ipAddressPrefixTable
mib_init: initializing: ipDefaultRouterTable
mib_init: initializing: ipDefaultRouterTable
mib_init: initializing: lmsensorsMib
mib_init: initializing: hr_swinst
mib_init: initializing: hr_swrun
mib_init: initializing: hr_system
mib_init: initializing: hr_device
mib_init: initializing: hr_other
mib_init: initializing: hr_proc
mib_init: initializing: hr_network
mib_init: initializing: hr_print
mib_init: initializing: hr_disk
mib_init: initializing: hr_partition
mib_init: initializing: hrh_storage
mib_init: initializing: hrh_filesys
mib_init: initializing: ipv4InterfaceTable
mib_init: initializing: ifTable
mib_init: initializing: ipv4InterfaceTable
mib_init: initializing: ipv6InterfaceTable
mib_init: initializing: ifXTable
mib_init: initializing: ipv6InterfaceTable
mib_init: initializing: ipAddressTable
mib_init: initializing: ipAddressTable
mib_init: initializing: ipv6ScopeZoneIndexTable
mib_init: initializing: ipv6ScopeZoneIndexTable
mib_init: initializing: ipIfStatsTable
mib_init: initializing: ipIfStatsTable
mib_init: initializing: sctpScalars
mib_init: initializing: tcpConnectionTable
mib_init: initializing: tcpConnectionTable
mib_init: initializing: tcpListenerTable
mib_init: initializing: tcpListenerTable
mib_init: initializing: udpEndpointTable
mib_init: initializing: udpEndpointTable
mib_init: initializing: interface
mib_init: initializing: ifTable
mib_init: initializing: sctpAssocRemAddrTable
mib_init: initializing: sctpAssocLocalAddrTable
mib_init: initializing: sctpLookupLocalPortTable
mib_init: initializing: sctpLookupRemPortTable
mib_init: initializing: sctpLookupRemHostNameTable
mib_init: initializing: sctpLookupRemPrimIPAddrTable
mib_init: initializing: sctpLookupRemIPAddrTable
mib_init: initializing: sctpAssocTable
mib_init: initializing: etherStatsTable
mib_init: initializing: etherStatsTable
mib_init: initializing: dot3StatsTable
mib_init: initializing: dot3StatsTable
mib_init: initializing: hw_sensors
mib_init: initializing: snmpMPDStats_5_5
mib_init: initializing: usmStats_5_5
mib_init: initializing: snmpEngine
mib_init: initializing: usmUser
mib_init: initializing: snmp_mib_5_5
mib_init: initializing: system_mib
mib_init: initializing: sysORTable
mib_init: initializing: at
mib_init: initializing: ip
mib_init: initializing: tcp
mib_init: initializing: icmp
mib_init: initializing: udp
mib_init: initializing: vacm_vars
mib_init: initializing: setSerialNo
mib_init: initializing: ipv6
mib_init: initializing: proc
mib_init: initializing: versioninfo
mib_init: initializing: pass
mib_init: initializing: pass_persist
mib_init: initializing: disk
mib_init: initializing: loadave
mib_init: initializing: extend
mib_init: initializing: errormib
mib_init: initializing: file
mib_init: initializing: dlmod
mib_init: initializing: proxy
mib_init: initializing: logmatch
mib_init: initializing: memory
mib_init: initializing: vmstat
mib_init: initializing: snmpNotifyTable
mib_init: initializing: snmpNotifyFilterProfileTable
mib_init: initializing: notification_log
mib_init: initializing: target_counters_5_5
mib_init: initializing: snmpTargetAddrEntry
mib_init: initializing: snmpTargetParamsEntry
mib_init: initializing: nsTransactionTable
mib_init: initializing: nsModuleTable
mib_init: initializing: nsDebug
mib_init: initializing: nsCache
mib_init: initializing: nsLogging
mib_init: initializing: nsVacmAccessTable
mib_init: initializing: mteScalars
mib_init: initializing: mteTrigger
mib_init: initializing: mteTriggerTable
mib_init: initializing: mteTriggerDeltaTable
mib_init: initializing: mteTriggerExistenceTable
mib_init: initializing: mteTriggerBooleanTable
mib_init: initializing: mteTriggerThresholdTable
mib_init: initializing: mteTriggerConf
mib_init: initializing: mteEvent
mib_init: initializing: mteEventTable
mib_init: initializing: mteEventSetTable
mib_init: initializing: mteEventNotificationTable
mib_init: initializing: mteEventConf
mib_init: initializing: mteObjects
mib_init: initializing: mteObjectsTable
mib_init: initializing: mteObjectsConf
mib_init: initializing: schedCore
mib_init: initializing: schedConf
mib_init: initializing: schedTable
mib_init: initializing: override
mib_init: initializing: cpu
mib_init: initializing: cpu_linux
mib_init: initializing: hw_mem
mib_init: initializing: hw_fsys
mib_init: initializing: var_route
mib_init: initializing: tcpTable
mib_init: initializing: udpTable
mib_init: initializing: vacm_context
mib_init: initializing: ip_scalars
mib_init: initializing: snmpNotifyFilterTable
mib_init: initializing: snmpNotifyFilterTable
mib_init: initializing: ifXTable
mib_init: initializing: inetNetToMediaTable
mib_init: initializing: inetNetToMediaTable
mib_init: initializing: ipSystemStatsTable
mib_init: initializing: ipSystemStatsTable
mib_init: initializing: ipCidrRouteTable
mib_init: initializing: ipCidrRouteTable
mib_init: initializing: inetCidrRouteTable
mib_init: initializing: inetCidrRouteTable
Configuration directives understood:
  In snmpd.conf and snmpd.local.conf:
    authtrapenable           1 | 2      (1 = enable, 2 = disable)
    trapsink                 host [community] [port]
    trap2sink                host [community] [port]
    informsink               host [community] [port]
    trapsess                 [snmpcmdargs] host
    trapcommunity            community-string
    v1trapaddress            string
    agentuser                userid
    agentgroup               groupid
    agentaddress             SNMP bind address
    quit                     (1|yes|true|0|no|false)
    leave_pidfile            (1|yes|true|0|no|false)
    dontLogTCPWrappersConnects (1|yes|true|0|no|false)
    maxGetbulkRepeats        integerValue
    maxGetbulkResponses      integerValue
    injectHandler            injectHandler NAME INTONAME [BEFORE_OTHER_NAME]
    table                    tableoid
    add_row                  table_name indexes... values...
    agentxsocket             AgentX bind address
    master                   specify 'agentx' for AgentX support
    agentxperms              AgentX socket permissions: socket_perms [directory_perms [username|userid [groupname|groupid]]]
    agentxRetries            AgentX Retries
    agentxTimeout            AgentX Timeout (seconds)
    com2sec                  [-Cn CONTEXT] secName IPv4-network-address[/netmask] community
    com2sec6                 [-Cn CONTEXT] secName IPv6-network-address[/netmask] community
    com2secunix              [-Cn CONTEXT] secName sockpath community
    perl                     PERLCODE
    perlInitFile             string
    disablePerl              (1|yes|true|0|no|false)
    smuxpeer                 OID-IDENTITY PASSWORD
    smuxsocket               SMUX bind address
    createUser               username [-e ENGINEID] (MD5|SHA) authpassphrase [DES [privpassphrase]]
    agentSecName             string
    iquerySecName            string
    iqueryVersion            1 | 2c | 3
    iquerySecLevel           noAuthNoPriv | authNoPriv | authPriv
    group                    name v1|v2c|usm|... security
    access                   name context model level prefix read write notify
    setaccess                name context model level prefix viewname viewval
    view                     name type subtree [mask]
    authcommunity            authtype1,authtype2 community [default|hostname|network/bits [oid|-V view]]
    authuser                 authtype1,authtype2 [-s secmodel] user [noauth|auth|priv [oid|-V view]]
    authgroup                authtype1,authtype2 [-s secmodel] group [noauth|auth|priv [oid|-V view]]
    authaccess               name authtype1,authtype2 [-s secmodel] group view [noauth|auth|priv [context|context*]]
    rwcommunity              community [default|hostname|network/bits [oid]]
    rocommunity              community [default|hostname|network/bits [oid]]
    rwcommunity6             community [default|hostname|network/bits [oid]]
    rocommunity6             community [default|hostname|network/bits [oid]]
    rwuser                   user [noauth|auth|priv [oid]]
    rouser                   user [noauth|auth|priv [oid]]
    ignoredisk               name
    skipNFSInHostResources   (1|yes|true|0|no|false)
    realStorageUnits         (1|yes|true|0|no|false)
    storageUseNFS            1 | 2      (1 = enable, 2 = disable)
    interface_fadeout        interface_fadeout seconds
    interface_replace_old    interface_replace_old yes|no
    interface                name type speed
    sysdescr                 description
    syslocation              location
    syscontact               contact-name
    sysname                  node-name
    sysservices              NUMBER
    sysobjectid              OID
    setserialno              integer
    proc                     process-name [max-num] [min-num]
    procfix                  process-name program [arguments...]
    pass                     miboid command
    pass_persist             miboid program
    disk                     path [ minspace | minpercent% ]
    includeAllDisks          minpercent%
    load                     max1 [max5] [max15]
    file                     file [maxsize]
    dlmod                    module-name module-path
    proxy                    [snmpcmd args] host oid [remoteoid]
    logmatch                 logmatch name path cycletime regex
    swap                     min-avail
    dontRetainLogs           (1|yes|true|0|no|false)
    doNotRetainNotificationLogs (1|yes|true|0|no|false)
    monitor                  triggername [-I] [-i OID | -o OID]* [-e event] expression 
    defaultMonitors          yes|no
    linkUpDownNotifications  yes|no
    notificationEvent        eventname notifyOID [-m] [-i OID|-o OID]*
    setEvent                 eventname [-I] OID = value
    strictDisman             (1|yes|true|0|no|false)
    repeat                   repeat period  OID = value
    cron                     cron * * * * * OID = value
    at                       at   * * * * * OID = value
    override                 [-rw] mibnode type value
    defDomain                application domain
    defTarget                application domain target
    engineID                 string
    engineIDType             num
    engineIDNic              string
  In snmp.conf and snmp.local.conf:
    alias                    NAME TRANSPORT_DEFINITION
    doDebugging              (1|0)
    debugTokens              token[,token...]
    logTimestamp             (1|yes|true|0|no|false)
    mibdirs                  [mib-dirs|+mib-dirs|-mib-dirs]
    mibs                     [mib-tokens|+mib-tokens]
    mibfile                  mibfile-to-read
    showMibErrors            (1|yes|true|0|no|false)
    commentToEOL             (1|yes|true|0|no|false)
    strictCommentTerm        (1|yes|true|0|no|false)
    mibAllowUnderline        (1|yes|true|0|no|false)
    mibWarningLevel          integerValue
    mibReplaceWithLatest     (1|yes|true|0|no|false)
    printNumericEnums        (1|yes|true|0|no|false)
    printNumericOids         (1|yes|true|0|no|false)
    escapeQuotes             (1|yes|true|0|no|false)
    dontBreakdownOids        (1|yes|true|0|no|false)
    quickPrinting            (1|yes|true|0|no|false)
    numericTimeticks         (1|yes|true|0|no|false)
    oidOutputFormat          integerValue
    suffixPrinting           integerValue
    extendedIndex            (1|yes|true|0|no|false)
    printHexText             (1|yes|true|0|no|false)
    printValueOnly           (1|yes|true|0|no|false)
    dontPrintUnits           (1|yes|true|0|no|false)
    hexOutputLength          integerValue
    dumpPacket               (1|yes|true|0|no|false)
    reverseEncodeBER         (1|yes|true|0|no|false)
    defaultPort              integerValue
    defCommunity             string
    noTokenWarnings          (1|yes|true|0|no|false)
    noRangeCheck             (1|yes|true|0|no|false)
    persistentDir            string
    tempFilePattern          string
    noDisplayHint            (1|yes|true|0|no|false)
    16bitIDs                 (1|yes|true|0|no|false)
    clientaddr               string
    clientaddrUsesPort       (1|yes|true|0|no|false)
    serverSendBuf            integerValue
    serverRecvBuf            integerValue
    clientSendBuf            integerValue
    clientRecvBuf            integerValue
    noPersistentLoad         (1|yes|true|0|no|false)
    noPersistentSave         (1|yes|true|0|no|false)
    noContextEngineIDDiscovery (1|yes|true|0|no|false)
    defDomain                application domain
    defTarget                application domain target
    defSecurityModel         string
    defSecurityName          string
    defContext               string
    defPassphrase            string
    defAuthPassphrase        string
    defPrivPassphrase        string
    defAuthMasterKey         string
    defPrivMasterKey         string
    defAuthLocalizedKey      string
    defPrivLocalizedKey      string
    defVersion               1|2c|3
    defAuthType              MD5|SHA
    defPrivType              DES|AES
    defSecurityLevel         noAuthNoPriv|authNoPriv|authPriv
  In agentx.conf and agentx.local.conf:
    agentxsocket             AgentX bind address
    agentxperms              AgentX socket permissions: socket_perms [directory_perms [username|userid [groupname|groupid]]]
    agentxRetries            AgentX Retries
    agentxTimeout            AgentX Timeout (seconds)

答案1

如果您不需要 snmp 监控 sendmail,您可以在启动时禁用相应的模块。
使用"-I -mta_sendmail"选项:

snmpd -I -mta_sendmail

相关内容