Ad Widget

Collapse

Unable to graph used swap space

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Clansman
    Junior Member
    • May 2006
    • 28

    #1

    Unable to graph used swap space

    Hi everyone,

    I've been using zabbix and one of my purposes is to monitor the swap usage on unix servers. I know there are monitored items for Total Swap Space and Free Swap Space. However, the graphing feature doesn't support drawing formulas, so I'm still stuck.

    What I've done (after looking around in this forum) was to add an UserParameter like:
    Code:
    UserParameter=system.swap.used,grep "Swap:" /proc/meminfo | cut -d ' ' -f 3
    Apparently it would work:
    Code:
    /usr/local/zabbix/bin/zabbix_agentd -t system.swap.used
    system.swap.used                              [t|129363968]
    ... but it doesn't. I added "Used Swap Space" as a monitoring item with data type=numeric (integer 64 bit), and, by looking at "Latest Values", this item shows up as '-'.

    I have a feeling that the issue here could be the data type, since the UserParameter could be interpreted as a string instead of an integer just like the following.
    Code:
    system[uname]                                 [t|Linux xyz.xyz.pt 2.4.21...]
    system.hostname                               [t|xyz.xyz.pt]
    system.uname                                  [t|Linux xyz.xyz.pt]
    What am I doing wrong? Is the problem really the data type? Is there a way to explicitly cast the numeric type onto the userparameter? Has anyone else done this sucessfully?

    Cheers,
    Pedro Venda.
  • just2blue4u
    Senior Member
    • Apr 2006
    • 347

    #2
    to verify if the data type is responsiple for that error, just type
    Code:
    zabbix_get -s <client-hostname-or-ip> -k system.swap.used
    on Server's console. This should get you the latest data for your UserParameter from the agent.

    Which version do you use?
    Some betas had problems with the limit of data type "Integer" (search forum for more information)...
    Last edited by just2blue4u; 07-06-2006, 10:12.
    Big ZABBIX is watching you!
    (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

    Comment

    • Clansman
      Junior Member
      • May 2006
      • 28

      #3
      Hi,

      Originally posted by just2blue4u
      to verify if the data type is responsiple for that error, just type
      Code:
      zabbix_get -s <client-hostname-or-ip> -k system.swap.used
      on Server's console. This should get you the latest data for your UserParameter from the agent.
      I see there's clearly a problem here...
      Code:
      ./zabbix_get -s xyz.xyz.pt -k system.swap.used
      Swap: 534634496 130170880 404463616
      ./zabbix_agentd -t system.swap.used
      system.swap.used                              [t|130170880]
      I'll try to figure it out by messing with the command line... It's very odd that the agent seems to get it right and the _get doesn't...

      EDIT: I've restarted both agent and server and now both calls return the same value.

      Which version do you use?
      1.1 :-)

      Cheers,
      Pedro Venda.
      Last edited by Clansman; 07-06-2006, 10:21.

      Comment

      • Clansman
        Junior Member
        • May 2006
        • 28

        #4
        ... it works now ...

        Must have been my fault - changing something and not restarting the services.

        Thanks for the tips,
        Cheers,
        Pedro Venda.

        Comment

        Working...