Skip navigation
1 2 Previous Next 13416 Views 22 Replies Latest reply: Nov 16, 2012 12:07 AM by jlee RSS
Dave_the_Dude Rank: White Belt 39 posts since
Aug 3, 2010
Currently Being Moderated

Jun 27, 2011 4:37 PM

Mac OS X Zenpack (1.8) - it's alive!!

Hello everyone,

 

I've completed development of a Mac OS X zenpack that should work for all Mac OS X systems from OS X version 10.4 to 10.6. Have tested this on multiple XServe boxes in our environment, and so far, it is working great.

 

This Mac OS X Zenpack offers:

 

  • full CPU monitoring
  • full Memory monitoring
  • process count and thread monitoring
  • load monitoring with a dotted line to show how many CPU cores are active (load avg numbers without knowing core count are worthless)
  • 2 modeler plugins to collect Hardware, OS info, and Serial Number
  • cute little custom Apple icon

 

To my knowledge, this is currently the only available Mac OS X zenpack to actually work properly, and allow you to monitor statistics as seen by the Mac OS X kernel itself. It doesn't use SNMP for much, but you can use it if you want to. The modeler plugin and monitoring scripts all use SSH.

 

 

The main device page:

macosx-mainpage.png

 

Performance graphs provided with the Zenpack:

macosx-graph-cpu.png

macosx-graph-memory.png

macosx-graph-load.png

macosx-graph-pnt.png

 

 

Requirements:

  • Zenoss 3.x (verified working in Zenoss 3.1.0)
  • SSH access to your monitored device - you MUST set either the SSH key to use, or zCommandUsername and zCommandPassword in Configuration Properties
  • Perl 5
  • Perl 5 module - Net::SSH::Perl
  • Perl 5 module - Math::BigInt::GMP
  • Perl 5 module - Math::BigInt::Pari
  • Mac OS X 10.4-10.6 devices to be monitored
  • A good sense of humor is always beneficial

 

 

Installation:

  1. Move the Zenpack to your /opt/zenoss directory and make sure it is owned by the zenoss user
  2. As the root user, install the required Perl modules:
  3. root# perl -MCPAN -e shell
  4. cpan> install Math::BigInt::GMP
  5. cpan> install Math::BigInt::Pari
  6. cpan> install Net::SSH::Perl
  7. As the zenoss user, run the following commands:    
  8. zenoss# zenpack --install /opt/zenoss/ZenPacks.ddevers.MacOSX-1.4-py2.6.egg
  9. zenoss# zenoss restart (or if you want, you can just use: zopectl restart)
  10. Et voila! You're done. You can now start adding devices to the "/Server/MacOSX" device class.
    • bigegor ZenossMaster 208 posts since
      Apr 23, 2009
      Currently Being Moderated
      1. Jun 22, 2011 8:27 PM (in response to Dave_the_Dude)
      Re: Mac OS X Zenpack - working and winning!!

      Hello Dave_the_Dude,

       

      step 4 can be skipped.

      simply, put your icon file (server-apple.png) in ZenPacks/ddevers/MacOSX/skins/ZenPacks.ddevers.MacOSX directory, and set zIcon zProperty of "/Server/MacOSX" device class to: /zport/dmd/server-apple.png

       

      Egor

    • omeganon Rank: White Belt 69 posts since
      Jun 23, 2011
      Currently Being Moderated
      3. Jun 23, 2011 7:34 PM (in response to Dave_the_Dude)
      Re: Mac OS X Zenpack (1.5) - winning!!

      Hi!

       

      Testing this out, you seem to have hard-coded an incorrect path to your plugins (/home/zenoss) --

       

      Cmd: /home/zenoss/ZenPacks.ddevers.MacOSX-1.5-py2.6.egg/ZenPacks/ddevers/MacOSX/libexec/check_macosx_cpu 2 - Code: 2 - Msg: Misu

       

      --

      Omeganon

    • omeganon Rank: White Belt 69 posts since
      Jun 23, 2011
      Currently Being Moderated
      6. Jun 24, 2011 10:50 AM (in response to Dave_the_Dude)
      Re: Mac OS X Zenpack (1.5) - winning!!

      Hi!

       

      It was installed via stack-installer and it lives in /usr/local/zenoss/zenoss. The only ties to /home/zenoss are -

        - it is the home directory for the zenoss user account

        - I installed the zenpack from that directory.

       

      As far as the tales expression you use, I don't know how that information is stored. I'm confident that if I were to hard-code the path or use something based on $ZENHOME, that would solve it but it doesn't feel like the right solution.

       

      The full error message is :Cmd:  /home/zenoss/ZenPacks.ddevers.MacOSX-1.5-py2.6.egg/ZenPacks/ddevers/MacOSX/libexec/check_macosx_memory  simon.int - Code: 2 - Msg: Misuse of shell builtins

       

      I typically see this when trying to execute a command that doesn't exist, which is the case here.

       

      Thanks!

       

      --

      Marc

    • omeganon Rank: White Belt 69 posts since
      Jun 23, 2011
      Currently Being Moderated
      7. Jun 24, 2011 11:27 AM (in response to Dave_the_Dude)
      Re: Mac OS X Zenpack (1.5) - winning!!

      Hi again!

       

      A further comment (I'm not trying to pick, just help improve =) ). In the Requirements, you state -

       

         "SSH access to your monitored device - you MUST set either the SSH key to  use, or zCommandUsername and zCommandPassword in Configuration  Properties"

       

      The reality, however is that in each of your scripts, you've hardcoded the use of ~zenoss/.ssh/id_rsa and the ssh user 'noc'. zCommandUsername and zCommandPassword are never passed or referenced nor is there an ability to specify a different key file without editing each of your template scripts.

    • MattRK Rank: White Belt 57 posts since
      Apr 28, 2010
      Currently Being Moderated
      10. Jul 27, 2011 11:24 PM (in response to Dave_the_Dude)
      Re: Mac OS X Zenpack (1.8) - it's alive!!

      I'm downloading this now. Just curious why its not been added to the ZenPack page yet. Is it still in testing?

       

      Look forward to testing it out. Thanks for the hard work.

    • MattRK Rank: White Belt 57 posts since
      Apr 28, 2010
      Currently Being Moderated
      11. Jul 27, 2011 11:43 PM (in response to Dave_the_Dude)
      Re: Mac OS X Zenpack (1.8) - it's alive!!

      I guess my CentOS 5 system didn't have GCC installed. When I got to step 4 and got the following error:

       


      CPAN.pm: Going to build P/PJ/PJACKLAM/Math-BigInt-GMP-1.36.tar.gz

       

      Couldn't find your C compiler
      Compilation failed in require at Makefile.PL line 3.
      BEGIN failed--compilation aborted at Makefile.PL line 3.
      Running make test
        Make had some problems, maybe interrupted? Won't test
      Running make install
        Make had some problems, maybe interrupted? Won't install

       

      I exited the CPAN shell and ran a "YUM install gcc" and let it update and install GCC. After it finished i tried step 4 again and got another error:

       

      Removing previously used /root/.cpan/build/Math-BigInt-GMP-1.36

        CPAN.pm: Going to build P/PJ/PJACKLAM/Math-BigInt-GMP-1.36.tar.gz

      Can't link/include 'gmp.h', 'gmp'
      make: *** No targets specified and no makefile found.  Stop.
        /usr/bin/make  -- NOT OK
      Running make test
        Can't test without successful make
      Running make install
        make had returned bad status, install seems impossible

       

      Not really sure what to try next. Any thoughts?

    • MattRK Rank: White Belt 57 posts since
      Apr 28, 2010
      Currently Being Moderated
      12. Aug 1, 2011 7:18 PM (in response to MattRK)
      Re: Mac OS X Zenpack (1.8) - it's alive!!

      So a quick update. I am a Linux noob but i did some research and  apparently for OS's such as CentOS that are based on packages (Such as rpms using yum) using  something like CPAN is very very very bad. (Here is post from a CentOS dev if you are interested http://lists.centos.org/pipermail/centos/2007-February/033001.html) So for anyone that installed  Zenoss using a package on CentOS like i did, do the following: (I'm sure this goes for other distros too... but i'm not very knowledgeable outside of CentOS/Yum. As i said, i'm a linux noob)

       

      1. Install the RPMForge yum repository. (Instructions here: http://wiki.centos.org/AdditionalResources/Repositories/RPMForge)
      2. Replace Step 4 with: $ yum install perl-Math-BigInt-GMP
      3. Replace Step 5 with: $ yum install perl-Math-BigInt-Peri
      4. Replace Step 6 with: $ yum install perl-Net-SSH-Perl

       

      Other than the modifications to the install instructions everything else worked fine. Hopefully my instructions help other people besides me. I look forward to testing this out.

       

      Thanks again for your hard work!

    • jmp242 ZenossMaster 4,060 posts since
      Mar 7, 2007
      Currently Being Moderated
      13. Jul 28, 2011 9:14 AM (in response to MattRK)
      Re: Mac OS X Zenpack (1.8) - it's alive!!

      This isn't entirely true. Because Zenoss (often) uses a version of "stufF" like python and (maybe?) perl, that is a different version from the system, it's usually installed separately / locally to keep it isolated from breaking anything for the rest of the OS. In that case, you cannot use an RPM to install to the local version of the environment, and must use something like CPAN.

       

      --

      James Pulver

      Information Technology Area Supervisor

      LEPP Computer Group

      Cornell University

    • MattRK Rank: White Belt 57 posts since
      Apr 28, 2010
      Currently Being Moderated
      14. Jul 28, 2011 3:54 PM (in response to jmp242)
      Re: Mac OS X Zenpack (1.8) - it's alive!!

      Ah. Well the above steps i outlined seemed to have worked for me. The only thing i'm having trouble with is SSH. I've added the zCommandUsername and zCommandPassword to the Configuration Properties of the /Server/MacOSX device class. I also verified that i am able to SSH into the servers with those credentials. Am i missing anything? Is the SSH Key required for this pack to work? I'm getting the following events for the server i added:

       

      (I get three errors. One for /Server/OSX/CPU, /Server/OSX/Processes, & /Server/OSX/Memory)

       

      Cmd:  /opt/zenoss/ZenPacks/ZenPacks.ddevers.MacOSX-1.8-py2.6.egg/ZenPacks/ddevers/MacOSX/libexec/check_macosx_cpu  10.1.44.201 "root" "*********" "/home/zenoss/.ssh/id_rsa" - Code: 2 -  Msg: Misuse of shell builtins

    1 2 Previous Next

    More Like This

    • Retrieving data ...