Ad Widget

Collapse

Is anyone successfully monitoring a Mac?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • O2Si
    Junior Member
    • Dec 2010
    • 2

    #1

    Is anyone successfully monitoring a Mac?

    I have seen a lot of requests for information on monitoring an OSX machine. I can find not current information on getting a zabbix client to work.

    I am attempting to monitor Mac systems on remote networks. I have a proxy running at one site but not the others.

    It would be great to hear from anyone that is successfully monitoring Mac and how they are doing it.

    Thank you in advance.
  • untergeek
    Senior Member
    Zabbix Certified Specialist
    • Jun 2009
    • 512

    #2
    There were compiling instructions for 10.5 (Leopard), but things broke again for 10.6 (Snow Leopard).

    I haven't tried to compile again. I believe the Agent can be made to work, but several of the built-in tests will not work, or will not yield the results you want.

    Running the Zabbix server on 10.5 was difficult; in 10.6 it may not work at all. I haven't really tried. I've been meaning to get a zabbix_proxy running on 10.6 but haven't had the time.

    Comment

    • untergeek
      Senior Member
      Zabbix Certified Specialist
      • Jun 2009
      • 512

      #3
      I recently compiled for my Mac (OS 10.6.7) and it's working, with some caveats.

      I was using the previous version of Xcode (3.something). You'll have to pay to get Xcode now in the app store ($4.99).

      ./configure --with-sqlite3 --enable-proxy --enable-agent

      I was able to compile a working proxy and agent. I was not able to get net-snmp to work with the proxy, but might with more work.

      Comment

      • untergeek
        Senior Member
        Zabbix Certified Specialist
        • Jun 2009
        • 512

        #4
        Code:
        buh@blackbox (01:17 PM) [/usr/local/bin] $ ./zabbix_get -V
        Zabbix Get v1.8.4 (revision 16604) (4 January 2011)
        Compilation time: Feb 26 2011 14:19:44
        buh@blackbox (01:17 PM) [/usr/local/bin] $ file zabbix_get 
        zabbix_get: Mach-O 64-bit executable x86_64
        buh@blackbox (01:17 PM) [/usr/local/bin] $ uname -a
        Darwin [redacted] 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386

        Comment

        • nleaman
          Member
          • May 2010
          • 35

          #5
          I've compiled 1.8.5 agent on OS X 10.5.6 Leopard (darwin 9 PPC 64bit & Intel 64bit) and 1.8.6 agent on OS X 10.6 Snow Leopard (darwin 10 Intel 32bit and 64bit) and OS X 10.7.1 Lion (darwin 11 Intel 64 bit). Haven't dealt with it yet, but the new 1.8.6 agent isn't compiling on 10.5/darwin9 systems, 1.8.5 does though so it's not a high priority for me.

          WARNING: The rest of this is from notes I kept while getting Zabbix to compile many months ago now. Hopefully it's helpful, but there could be errors. Also, there is no MySql related install/setup notes here (other than the needed MySQL lib files).

          I'm able to compile Zabbix server 1.8.6 on Mac OS 10.6.7 Server with Xcode 3.2.2 using these args:
          Code:
          ./configure  -prefix=/Users/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber=/usr/local --with-libcurl --with-ldap --with-ssh2 LDFLAGS=-lz
          To get that to work, had to do the following:

          1. Need Xcode installed (of course, right?)

          2. Compile Fast Ping
          Code:
          # Fast Ping
          cd /tmp/source
          curl -O http://fping.sourceforge.net/download/fping.tar.gz
          gunzip fping.tar.gz && tar -xvf fping.tar
          cd fping-2.4b2_to
          ./configure
          make
          sudo make install
          sudo chmod 4755 /usr/local/sbin/fping # set setuid root
          3. Expand MySQL lib files into place (/usr/include/mysql/)
          Code:
          cd /tmp/source
          curl -O http://www.opensource.apple.com/other/MySQL-53.binaries.tar.gz
          sudo tar -xzvf MySQL-53.binaries.tar.gz -C /
          4. Install iksemel libs (Jabber) ... (not using this yet, but it does compile so why not)
          Code:
          cd /tmp/source
          curl -O http://iksemel.googlecode.com/files/iksemel-1.4.tar.gz
          gunzip iksemel-1.4.tar.gz && tar -xvf iksemel-1.4.tar
          cd iksemel-1.4
          ./configure
          make
          sudo make install
          5. Install SSH2 libs (libssh2)
          Code:
          cd /tmp/source
          curl -O http://www.libssh2.org/download/libssh2-1.2.5.tar.gz
          gunzip libssh2-1.2.5.tar.gz && tar -xvf libssh2-1.2.5.tar
          cd libssh2-1.2.5
          ./configure
          make
          #make check
          sudo make install
          6. Install Zabbix server
          Code:
          # 1.8.6
          curl -O http://cdnetworks-us-2.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/1.8.6/zabbix-1.8.6.tar.gz
          gunzip zabbix-1.8.6.tar.gz && tar -xvf zabbix-1.8.6.tar
          
          # Had to modify checks_snmp.c (this is a sneaky one):
          
          sed -ie 's/ASN_INTEGER ||/ASN_INTEGER/' ./src/zabbix_server/poller/checks_snmp.c
          7. Beef up some kernel settings related to "System V Shared Memory segments" (see http://support.apple.com/kb/HT4022 for more info):
          Code:
          kern.sysv.shmall=2097152
          kern.sysv.shmmax=2147483648
          kern.sysv.shmmni=4096
          kern.sysv.semmsl=250
          kern.sysv.semmns=32000
          kern.sysv.semopm=100
          kern.sysv.semmni=128
          Set them permanently by creating/editing /etc/sysctl.conf:

          Code:
          # WARNING: this will overwrite /etc/sysctl.conf if it already exists
          echo 'kern.sysv.shmall=2097152
          kern.sysv.shmmax=2147483648
          kern.sysv.shmmni=4096
          kern.sysv.semmsl=250
          kern.sysv.semmns=32000
          kern.sysv.semopm=100
          kern.sysv.semmni=128
          ' > /etc/sysctl.conf
          
          # set perms on /etc/sysctl.conf to match this:
          # $ ls -l /etc/sysctl.conf
          # -rw-r--r--  1 root  wheel  162 May  6  2010 /etc/sysctl.conf
          
          # then reboot
          # verify using: sysctl kern.sysv
          Extra, and not related to compiling... Not sure is this was an only on apache running on Mac OS Server thing, but for the php front-end, I was having problems with php caching form field values... adding this to include/config.inc.php was my way to resolving it:

          Code:
          header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
          header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
          header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
          header("Cache-Control: post-check=0, pre-check=0", false);
          header("Pragma: no-cache");

          Comment

          • frater
            Senior Member
            • Oct 2010
            • 340

            #6
            Would you like to share an OSX agent binary?
            I see a lot of external sources claiming Zabbix supports OSX, but if I look on the Zabbix site itself it seems as if OSX does not exist.

            I am not into Macs, but I would like to monitor a few without having to install a development kit.
            Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

            Comment

            • nleaman
              Member
              • May 2010
              • 35

              #7
              OS X / Darwin agent binaries

              Here are a few darwin binaries: https://files.me.com/noah/sjpgqy

              Included are the following OS X architectures:
              agent-ppc-64bit_185
              agent-x86-32bit_185
              agent-x86-64bit-darwin9_185
              agent-x86-64bit_185
              agent-x86-64bit_186

              All these are for darwin 10 & 11 except the one that is named darwin9.

              darwin9 = Mac OS X 10.5.x (Leopard)
              darwin10 = Mac OS X 10.6.x (Snow Leopard)
              darwin11 = OS X 10.7.x (Lion)

              Let me know if you have any issues. I can provide Server and Proxy binaries if needed.

              Comment

              • bushidoka
                Junior Member
                • Dec 2011
                • 4

                #8
                This seems to be an appropriate thread to bump.

                I have the most recent Zabbix VM appliance running in order to evaluate the product versus a couple of others, and in general am liking it quite a bit. I was able to build the agent for both RHEL5 and Mac and get them running fine for the most part, except that I notice there are no predefined graphs for the Mac.

                OK, that's fine, it seems easy enough to go and define my own. So I go ahead and define a simple CPU utilisation graph against the Mac template, and put it together exactly like the CPU graph for the Linux template.

                Problem is there is nothing on the graph when I go try to look at it. What's up with that? It has been running now for a good hour like that but nada. I know the agent on the Mac is generally working because if I shut it down or whatever then Zabbix server raises the alarm quickly enough.

                Thanks.

                EDIT: p.s. Max OSX 10.7 (latest)
                Last edited by bushidoka; 15-12-2011, 22:21. Reason: p.s.

                Comment

                • sosi
                  Junior Member
                  • Dec 2011
                  • 1

                  #9
                  Launch plist and init file

                  For those of us using the precompiled agent for OS X (thanks nleaman), can someone please post the plist file - org.macports.zabbix.plist - for LaunchDaemons? It appears that startup may call the file zabbix_agentd.init? If so, it would be much appreciated if that was posted as well. Thanks.

                  Comment

                  • nleaman
                    Member
                    • May 2010
                    • 35

                    #10
                    A launchd item (plist) will be defined differently depending on your specific environment so there won't be such a thing as a plist that just works for everyone.

                    Also, it's best you learn how to use launchctl because you'll need to manage (start/stop, load/unload) the process with it.

                    With that said, here is an example launchd item that's pretty straight forward. It simply start zabbix_agentd on startup:

                    Save it to: /Library/LaunchDaemons
                    Name the file: com.zabbix.agentd.plist (or anything you want as long as it matches the Label string element within the plist)
                    Important: Replace YOUR_PATH_HERE with your paths and replace ZABBIX_USERNAME with the user you want to run the process as (otherwise com.zabbix.agentd.plist will run zabbix_agentd as root on startup, which you may not want)

                    Code:
                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                    <plist version="1.0">
                    <dict>
                    	<key>Label</key>
                    	<string>com.zabbix.agentd</string>
                    	<key>ProgramArguments</key>
                    	<array>
                    		<string>YOUR_PATH_HERE/zabbix_agentd</string>
                    		<string>-c</string>
                    		<string>YOUR_PATH_HERE/zabbix_agentd.conf</string>
                    	</array>
                    	<key>RunAtLoad</key>
                    	<true/>
                    	<key>UserName</key>
                    	<string>ZABBIX_USERNAME</string>
                    </dict>
                    </plist>

                    You don't have to reboot to test (although you will want to try that at some point). Just run (load) it manually:
                    Code:
                    sudo launchctl load /Library/LaunchDaemons/com.zabbix.agentd.plist
                    I having something similar setup but I don't start zabbix_agentd directly this way. Instead I have it run a shell script that in turn runs zabbix_agentd along with a few other lines to verify that it started (nc -zv 127.0.0.1 10050) and some other validation steps.

                    To manually start/stop/restart, as a non-admin (i.e., no sudo access) zabbix user, I load another launchd item that the zabbix user does have permissions to (meaning it's stored in ~/Library/LaunchAgents). Then, as needed, I just throw the "launchctl un/load" commands in the three zstart, zstop and zrestart shell scripts I use locally or remotely via ssh. I don't ever stop zabbix_agentd via launchd. I use kill and if needed killall in the zstop script to do that. But, I always start it using an unload, then a load. Having launchd start it fixed the "perl: no user" errors I was getting when the zabbix user was no longer logged.

                    Sorry this is a bit scattered, but let me know if you have any questions and I'll elaborate as needed.

                    For the purpose of future search hits, using launchd solved the problem I was having regarding a "perl: no user 501" error when running UserParameter scripts.

                    Comment

                    • CeeEss
                      Senior Member
                      Zabbix Certified Specialist
                      • Nov 2007
                      • 103

                      #11
                      Good stuff here, guys!

                      But (rhetorically) what is up with the OS_X template - what a mess of incompatible syscalls. Looks like the Linux template, simply renamed as OS_X. Unfortunately, some of of the parms will never work as they're embedded in the agent and would have to be intro'd as UserParameters instead.

                      Comment

                      • brianclam
                        Junior Member
                        • Aug 2012
                        • 1

                        #12
                        Link to OS X / Darwin agent binaries no longer works because Mobileme was shutdown

                        Mr. Nelaman (has a cool ring to it),

                        Thanks for posting the info for Zabbix agent for Mac OSX. Your post is the most descriptive from what I have been able to google.

                        I was reading your post on compiling Zabbix for Mac OSX as I am trying to set up Zabbix agent monitor for about 10 Mac OSX boxes with the following version:

                        10.6.2 (10C540) Internet Services OS build v5

                        root# uname -a
                        Darwin ... 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:35:19 PST 2009; root:xnu-1486.2.11~1/RELEASE_X86_64 x86_64


                        The URL for the binaries is not longer working because Mobileme was shut down recently:




                        Do you still have the agent binaries and if so, could you upload somewhere else?

                        Thanks!

                        Comment

                        • CeeEss
                          Senior Member
                          Zabbix Certified Specialist
                          • Nov 2007
                          • 103

                          #13
                          Big thank you to Zabbix for enabling network interface metrics in agentd on OSX (intended or not)! In 1.8.10 net.if.anything was ZBX_NOTSUPPORTED, but in 2.0.2 it is.

                          > zabbix_get -s machost -k"agent.version"
                          2.0.2

                          > zabbix_get -s machost -k"net.if.out[en0,bytes]"
                          16371535

                          Brilliant - made my day!

                          Comment

                          • dpbaker57
                            Member
                            • Aug 2010
                            • 33

                            #14
                            Vote to have Zabbbix build it themselves.

                            I too could not download the binaries due to the end of mobile me.

                            We should all vote up:


                            So Zabbix will create a working binary for us.

                            Comment

                            Working...