Ad Widget

Collapse

Swap percentage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • egon
    Junior Member
    • Feb 2005
    • 4

    #1

    Swap percentage

    I'm using zabbix 1.0. Is there a way for me to monitor the percentage of swap used? I know I could set up a trigger with a formula to figure it out, but I'd like to set it up as a normal monitored item (sorry - I'm new to zabbix and am not that familiar with the terminology yet).

    Part of the reason I want to do this is so that I can graph percentage of swap used for several hosts.

    Thanks in advance.
  • cooper
    Senior Member
    • Sep 2004
    • 110

    #2
    Originally posted by egon
    I'm using zabbix 1.0. Is there a way for me to monitor the percentage of swap used? I know I could set up a trigger with a formula to figure it out, but I'd like to set it up as a normal monitored item (sorry - I'm new to zabbix and am not that familiar with the terminology yet).

    Part of the reason I want to do this is so that I can graph percentage of swap used for several hosts.

    Thanks in advance.
    swap % is not supported as an item in agent (yet?). The easiest way would be to set it up as a user defiend item in agentd.conf (http://www.zabbix.com/manual/v1.1/config_extend.php) and then pull that directly. On my gentoo box, the following one-liner would give me the % of swap used
    Code:
    free|tail -n -1|awk '{print $3/$2}'
    You could pop it into several agentd.conf files pretty quickly and then add the item to your host template.

    HTH

    cooper

    Comment

    • egon
      Junior Member
      • Feb 2005
      • 4

      #3
      Originally posted by cooper
      swap % is not supported as an item in agent (yet?).
      Yeah - I think what I was really looking for was to be able to set up an expression as a monitored item. I guess that's a wishlist item.

      Originally posted by cooper
      Code:
      free|tail -n -1|awk '{print $3/$2}'
      Just to take this a step further, I'm doing the following (seems to work under linux anyway)
      Code:
      free|awk '/Swap/{print ($3/$2)*100}'
      Originally posted by cooper
      HTH
      cooper
      It did indeed. Thanks for the info.

      -Egon

      Comment

      • cooper
        Senior Member
        • Sep 2004
        • 110

        #4
        Originally posted by egon
        Just to take this a step further, I'm doing the following (seems to work under linux anyway)
        Code:
        free|awk '/Swap/{print ($3/$2)*100}'
        -Egon
        Right on. Even with BASH, much like perl, "There's More Than One Way To Do It." Glad you got what you were looking for.

        later

        cooper

        Comment

        Working...