Ad Widget

Collapse

1.3.3 UserParameter problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • clahti
    Senior Member
    • Jan 2007
    • 126

    #1

    1.3.3 UserParameter problems

    hello all:

    I have several UserParameter scripts written in perl and bash that work fine. We have several Tomcat Java application servers that we need to monitor so a colleage wrote a small java program that captures the following Tomcat information:

    Code:
    ztc.active_jobs
    ztc.is_alive
    ztc.queue_size
    ztc.tc_free_mem
    ztc.tc_max_mem
    ztc.tc_total_mem
    The corresponding UserParameter entries in zabbix_agentd.conf:

    Code:
    UserParameter=ztc.active_jobs,/usr/lib/zabbix/ztc/ztc.sh -f active_jobs
    UserParameter=ztc.is_alive,/usr/lib/zabbix/ztc/ztc.sh -f is_alive
    UserParameter=ztc.queue_size,/usr/lib/zabbix/ztc/ztc.sh -f queue_size
    UserParameter=ztc.tc_free_mem,/usr/lib/zabbix/ztc/ztc.sh -f tc_free_mem
    UserParameter=ztc.tc_max_mem,/usr/lib/zabbix/ztc/ztc.sh -f tc_max_mem
    UserParameter=ztc.tc_total_mem,/usr/lib/zabbix/ztc/ztc.sh -f tc_total_mem
    testing from the client command line:

    Code:
    [root@giant ztc]# zabbix_agentd -p 2>/dev/null
    <snip...>
    ztc.active_jobs                               [t|0]
    ztc.is_alive                                  [t|1]
    ztc.queue_size                                [t|0]
    ztc.tc_free_mem                               [t|15.16]
    ztc.tc_max_mem                                [t|1016.12]
    ztc.tc_total_mem                              [t|35.07]
    All is good so far. The problem is when I define these as items on the zabbix server, all of these return unsupported. Here are the log entries:

    Code:
      6106:20070317:132513 Parameter [ztc.tc_free_mem] is not supported by agent on host [Giant] Old status [0]
      6105:20070317:132523 Parameter [ztc.queue_size] is not supported by agent on host [Giant] Old status [0]
      6110:20070317:132538 Parameter [ztc.is_alive] is not supported by agent on host [Giant] Old status [0]
      6109:20070317:132538 Parameter [ztc.active_jobs] is not supported by agent on host [Giant] Old status [0]
      6108:20070317:132539 Parameter [ztc.tc_total_mem] is not supported by agent on host [Giant] Old status [0]
      6107:20070317:132540 Parameter [ztc.tc_max_mem] is not supported by agent on host [Giant] Old status [0]
    I even made the zabbix user on Giant a real user so that the JAVA_HOME gets set properly, and from the client this works fine:

    Code:
    [root@giant ztc]# su - zabbix
    -bash-3.00$ zabbix_agentd -p 2>/dev/null
    <snip...>
    ztc.active_jobs                               [t|0]
    ztc.is_alive                                  [t|1]
    ztc.queue_size                                [t|0]
    ztc.tc_free_mem                               [t|15.21]
    ztc.tc_max_mem                                [t|1016.12]
    ztc.tc_total_mem                              [t|35.07]
    The script works fine executed as the zabbix user, any ideas? all items are defined as float types.

    /Christian
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #2
    Greetings,
    Originally posted by clahti
    I have several UserParameter scripts written in perl and bash that work fine. We have several Tomcat Java application servers that we need to monitor so a colleage wrote a small java program that captures the following Tomcat information
    Right off the bat I would suggest looking a the agent timeout values. I haven't looked at 1.3.3 recently, but I seem to recall the timeout was still set to 3 seconds on the agents and 5 seconds on the server. If the agent times out while performing a check, the server marks it as not supported, if the server times out the item is marked as no data. Traditionally, java start times are pretty high, around 5 - 10 seconds, which will cause a not supported to be reported. The agent will still pass the -p (pretend) tests, but will not complete fast enough for the agent when the data is being queried by the server.
    Unofficial Zabbix Developer

    Comment

    • clahti
      Senior Member
      • Jan 2007
      • 126

      #3
      Originally posted by James Wells
      Greetings,

      Right off the bat I would suggest looking a the agent timeout values. I haven't looked at 1.3.3 recently, but I seem to recall the timeout was still set to 3 seconds on the agents and 5 seconds on the server. If the agent times out while performing a check, the server marks it as not supported, if the server times out the item is marked as no data. Traditionally, java start times are pretty high, around 5 - 10 seconds, which will cause a not supported to be reported. The agent will still pass the -p (pretend) tests, but will not complete fast enough for the agent when the data is being queried by the server.
      Ok, I solved this Head Scratcher (TM). I had to hard code the path to java in the ztc.sh script, for some reason when the server requested the parameter value from the agent it was not picking up $JAVA_HOME from /etc/profile (even though this works from the client itself!) So word to the wise, setup any environment stuff you need for your scripts *IN* your scripts or at least source an environment script. Thanks for the response James.

      /Christian

      Comment

      • RobertS
        Member
        • Aug 2006
        • 57

        #4
        Hello Christian,

        I am interested in your Tomcat monitoring scripts. Is it possible for you to make them public?

        Thanks,
        Robert

        Comment

        • clahti
          Senior Member
          • Jan 2007
          • 126

          #5
          Originally posted by RobertS
          Hello Christian,

          I am interested in your Tomcat monitoring scripts. Is it possible for you to make them public?

          Thanks,
          Robert
          These are not quite ready for prime time, but I will post to the cookbook when it is cleaned up a bit

          Comment

          Working...