Menu

#1757 5.4 on OSX: unable to monitor processes

macOS
closed
nobody
agent (1105)
5
2012-11-08
2007-01-15
Troy
No

Using the bundled SNMP agent that comes with OS X 10.4 I was able to get a list of running processes, their memory usage / CPU usage etc.

Because of the bug with multiple calls to the free space MIB's causing snmpd to crash - I have had to upgrade to the current release.

With a working install of the current release - I no longer the the process details and if I try and manually add them with a proc directive in the .conf file - i get the error :

Starting SNMP service
/usr/share/snmp/snmpd.conf: line 47: Error: Already have an entry for this process.
/usr/share/snmp/snmpd.conf: line 48: Error: Already have an entry for this process.
/usr/share/snmp/snmpd.conf: line 49: Error: Already have an entry for this process.

Install Details:
NET-SNMP version 5.4
Darwin Kernel Version 8.8.0: Fri Sep 8 17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh powerpc

Patches Applied: 1600522, 1600453

Configure Options: --with-persistent-directory=/var/db/net-snmp --with-defaults
--without-rpm --with-mib-modules="host ucd-snmp/diskio"
--with-out-mib-modules="mibII/icmp host/hr_swrun host/hr_network"
--disable-static --without-kmem-usage --prefix=/usr --sysconfdir=/etc
CPPFLAGS=-I/System/Library/Frameworks/System.framework/PrivateHeaders
LIBS="-framework IOKit -framework CoreFoundation"

snmpd.conf:
rwcommunity testtest1

proc httpd
proc snmpd
proc dhcpd

syslocation "Test Test 1"
syscontact "Test 1 Administrator noc@SITE.DETAIL"
sysservices 76

Discussion

  • Thomas Anders

    Thomas Anders - 2007-01-15

    Logged In: YES
    user_id=848638
    Originator: NO

    Please run the agent with "-Dread_config" to double-check whether the agent is reading any of the "proc" directives twice.

     
  • Troy

    Troy - 2007-01-15

    Logged In: YES
    user_id=1652863
    Originator: YES

    It is being read-in twice. Starting the daemon with

    /usr/sbin/snmpd -c /usr/share/snmp/snmpd.conf -Lf /var/log/snmpd.log

    How do I stop it reading /usr/share/snmp/snmpd.conf twice?
    (If I don't pass it the config location it loads nothing at all)

     
  • Thomas Anders

    Thomas Anders - 2007-01-15

    Logged In: YES
    user_id=848638
    Originator: NO

    Add "-C" or set SNMPCONFPATH=/usr/share/snmp/snmpd.conf:/var/db/net-snmp (env var).
    Does it work, then?

     
  • Troy

    Troy - 2007-01-15

    Logged In: YES
    user_id=1652863
    Originator: YES

    By changing it to:
    /usr/sbin/snmpd -C -c /usr/share/snmp/snmpd.conf -Lf /var/log/snmpd.log

    I get the below in the log. It would appear that it isn't reading anything any more.

    /usr/share/snmp/snmpd.conf: Operation not supported on socket
    /usr/share/snmp/snmpd.conf: Operation not supported on socket
    Warning: no access control information configured.
    It's unlikely this agent can serve any useful purpose in this state.
    Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent.
    NET-SNMP version 5.4

     
  • Thomas Anders

    Thomas Anders - 2007-01-15

    Logged In: YES
    user_id=848638
    Originator: NO

    Weird. Please run with "-DALL" and/or under strace (or whatever strace/truss equivalent OSX ships with) to see what the agent is doing here. Please double-check that /usr/share/snmp/snmpd.conf is a regular file as expected.

     
  • Troy

    Troy - 2007-01-15

    Logged In: YES
    user_id=1652863
    Originator: YES

    Apologies. /usr/share/snmp/snmpd.conf had become a socket.
    I am not entirely sure how that happened by compiling, installing and then running snmpconf -i

    It has now been fixed.

    snmpd starts with no errors, but does not monitor the processes. snmpwalk returns to values for anything supplied with proc. I could be doing something wrong though - I am just snmpwalking the entire tree and grepping for httpd.

     
  • Thomas Anders

    Thomas Anders - 2007-01-15

    Logged In: YES
    user_id=848638
    Originator: NO

    Please "snmpwalk ... localhost UCD-SNMP-MIB::prTable" and post/verify the output.

     
  • Troy

    Troy - 2007-01-15

    Logged In: YES
    user_id=1652863
    Originator: YES

    They are there. Apologies for that.

    Is there any way to get back the functionality of the apple supplied agent?

    I had mib's with every process, memory use, cpu use etc.

     
  • Thomas Anders

    Thomas Anders - 2007-01-15

    Logged In: YES
    user_id=848638
    Originator: NO

    Should all be there. Just "snmpwalk -mall ... localhost .1" and check the output. If you spot any major difference, please tell us and attach the *full* snmpwalk against both the Apple supplied and the 5.4 agent here.

     
  • Troy

    Troy - 2007-01-15

    Logged In: YES
    user_id=1652863
    Originator: YES

    I would love to post a diff, to do that though I will need to rebuild the apple boxes. In my haste I just erased the existing snmpd binary instead of keeping it.

    With that being the case I guess we will have to close this ticket until I can build another box.

     
  • Thomas Anders

    Thomas Anders - 2007-01-15

    Logged In: YES
    user_id=848638
    Originator: NO

    Open a new one, then, because "proc" seems to be working in general on OSX, AFAICS.

     

Log in to post a comment.