Ad Widget

Collapse

Item keeps changing to unsupported on User Created Template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ccreamer
    Junior Member
    • Mar 2012
    • 9

    #1

    Item keeps changing to unsupported on User Created Template

    I created a template to check the the remaining free space in innodb for my mysql installation based off of the "Heavy MySQL monitoring solution". the item key keeps changing to "unsupported" status after each check. I have changed the Refresh unsupported items to 30 seconds, but this is still not an acceptable solution since the graph will only show dots. I am currently running the zabbix 1.8.10 appliance for vmware. Any help would be very much appreciated!

    Template Template_MySQL_Innodb_Free code:

    <?xml version="1.0"?>
    <zabbix_export version="1.0" date="03.21.11" time="11.04">
    <hosts>
    <host name="Template_MySQL_Innodb_Free">
    <useip>0</useip>
    <dns></dns>
    <ip></ip>
    <port>10050</port>
    <status>3</status>
    <groups>
    <group>Templates</group>
    </groups>
    <items>
    <item type="2" key="mysql.Innodb_Free" value_type="3">
    <description>MySQL: innodb_free</description>
    <delay>300</delay>
    <history>7</history>
    <trends>365</trends>
    <status>0</status>
    <units></units>
    <multiplier>0</multiplier>
    <delta>0</delta>
    <formula>1</formula>
    <lastlogsize>0</lastlogsize>
    <logtimefmt></logtimefmt>
    <delay_flex></delay_flex>
    <params></params>
    <trapper_hosts></trapper_hosts>
    <snmp_community></snmp_community>
    <snmp_oid></snmp_oid>
    <snmp_port>161</snmp_port>
    <snmpv3_securityname></snmpv3_securityname>
    <snmpv3_securitylevel>0</snmpv3_securitylevel>
    <snmpv3_authpassphrase></snmpv3_authpassphrase>
    <snmpv3_privpassphrase></snmpv3_privpassphrase>
    <applications>
    <application>MySQL2</application>
    </applications>
    </item>
    </items>
    <triggers>
    <trigger>
    <description>MySQL: free space in innodb {HOSTNAME}</description>
    <type>0</type>
    <expression>{{HOSTNAME}:mysql.Innodb_Free.last(0)} &gt;5G </expression>
    <url></url>
    <status>0</status>
    <priority>1</priority>
    <comments>Low free space in innodb</comments>
    </trigger>
    </triggers>
    </host>
    </hosts>
    </zabbix_export>



    command at end of zabbix_agentd.conf:

    UserParameter=mysql.Innodb_Free,./etc/zabbix/innodb_free.sh



    innodb_free.sh shell script:

    #!/bin/bash

    Query="show table status like 'wayside_unload';"

    freespace=$(echo "$Query" | mysql -urailstress -pbluez -t --host=$host rs_up | /bin/awk '/InnoDB free:/ {print $31}' )

    let "freespace = freespace * 1024"

    /usr/bin/zabbix_sender -z 192.168.0.126 -p 10051 -s vrs_db1_test -k mysql.Innodb_Free -o $freespace



    permissions in folder where shell script is stored:

    ######:root../zabbix>ls -ltrah
    total 104K
    -rw-r--r-- 1 root root 14K Mar 20 14:16 testlog
    -rw-r--r-- 1 zabbix zabbix 34K Mar 21 14:51 mysql.php
    -rw-r--r-- 1 root root 5.6K Mar 21 17:39 zabbix_agentd.conf
    drwxr-xr-x 76 root root 8.0K Mar 21 17:40 ..
    -rw-r--r-- 1 root root 63 Mar 22 09:20 .zabbix_mysql.utime
    -rw-r--r-- 1 root root 24 Mar 22 09:20 .zabbix_mysql.dtime
    -rw-r--r-- 1 root root 10K Mar 22 09:20 zabbix_mysql.log
    -rw-r--r-- 1 root root 6.5K Mar 22 09:20 zabbix_mysql.dat
    -rwxr-xr-x 1 zabbix zabbix 830 Mar 22 09:50 innodb_free.sh
    drwxr-xr-x 2 root root 4.0K Mar 22 09:50 .



    info from zabbix_agentd.log:

    933:20120322:095304.231 JSON before sending [{
    "request":"agent data",
    "data":[
    {
    "host":"vrs_db1_test",
    "key":"mysql.Innodb_Free",
    "value":"Info from server: \"Processed 1 Failed 0 Total 1 Seconds spent 0.000029\"\nsent: 1; skipped: 0; total: 1",
    "clock":1332424379},
    Attached Files
  • ccreamer
    Junior Member
    • Mar 2012
    • 9

    #2
    adding the full conf file just in case this will help

    # This is a config file for Zabbix Agent (Unix)
    # To get more information about Zabbix, visit http://www.zabbix.com

    ############ GENERAL PARAMETERS #################

    ### Option: PidFile
    # Name of PID file.
    #
    # Mandatory: no
    # Default:
    # PidFile=/tmp/zabbix_agentd.pid

    PidFile=/tmp/zabbix_agentd.pid

    ### Option: LogFile
    # Name of log file.
    # If not set, syslog is used.
    #
    # Mandatory: no
    # Default:
    # LogFile=

    LogFile=/tmp/zabbix_agentd.log

    ### Option: LogFileSize
    # Maximum size of log file in MB.
    # 0 - disable automatic log rotation.
    #
    # Mandatory: no
    # Range: 0-1024
    # Default:
    # LogFileSize=1

    ### Option: DebugLevel
    # Specifies debug level
    # 0 - no debug
    # 1 - critical information
    # 2 - error information
    # 3 - warnings
    # 4 - for debugging (produces lots of information)
    #
    # Mandatory: no
    # Range: 0-4
    # Default:
    # DebugLevel=3

    DebugLevel=4

    ### Option: SourceIP
    # Source IP address for outgoing connections.
    #
    # Mandatory: no
    # Default:
    # SourceIP=

    ### Option: EnableRemoteCommands
    # Whether remote commands from Zabbix server are allowed.
    # 0 - not allowed
    # 1 - allowed
    #
    # Mandatory: no
    # Default:
    # EnableRemoteCommands=0

    EnableRemoteCommands=1

    ### Option: LogRemoteCommands
    # Enable logging of executed shell commands as warnings.
    # 0 - disabled
    # 1 - enabled
    #
    # Mandatory: no
    # Default:
    # LogRemoteCommands=0

    ##### Passive checks related

    ### Option: Server
    # List of comma delimited IP addresses (or hostnames) of Zabbix servers.
    # No spaces allowed. First entry is used for receiving list of and sending active checks.
    # If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
    #
    # Mandatory: yes
    # Default:
    # Server=

    Server=<server ip removed for security reasons>


    ### Option: Hostname
    # Unique, case sensitive hostname.
    # Required for active checks and must match hostname as configured on the server.
    # Value is acquired from HostnameItem if undefined.
    #
    # Mandatory: no
    # Default:
    # Hostname=

    Hostname=<hostname removed for security reasons. This does match the host name on the server>

    ### Option: HostnameItem
    # Item used for generating Hostname if it is undefined.
    # Ignored if Hostname is defined.
    #
    # Mandatory: no
    # Default:
    # HostnameItem=system.hostname

    ### Option: ListenPort
    # Agent will listen on this port for connections from the server.
    #
    # Mandatory: no
    # Range: 1024-32767
    # Default:
    # ListenPort=10050

    ### Option: ListenIP
    # List of comma delimited IP addresses that the agent should listen on.
    #
    # Mandatory: no
    # Default:
    # ListenIP=0.0.0.0

    ### Option: DisablePassive
    # Disable passive checks. The agent will not listen on any TCP port.
    # Only active checks will be processed.
    # 0 - do not disable
    # 1 - disable
    #
    # Mandatory: no
    # Default:
    # DisablePassive=0

    ##### Active checks related

    ### Option: DisableActive
    # Disable active checks. The agent will work in passive mode listening for server.
    #
    # Mandatory: no
    # Default:
    # DisableActive=0

    ### Option: ServerPort
    # Server port for retrieving list of and sending active checks.
    #
    # Mandatory: no
    # Default:
    # ServerPort=10051

    ### Option: RefreshActiveChecks
    # How often list of active checks is refreshed, in seconds.
    #
    # Mandatory: no
    # Range: 60-3600
    # Default:
    # RefreshActiveChecks=120

    ### Option: BufferSend
    # Do not keep data longer than N seconds in buffer.
    #
    # Mandatory: no
    # Range: 1-3600
    # Default:
    # BufferSend=5

    ### Option: BufferSize
    # Maximum number of values in a memory buffer. The agent will send
    # all collected data to Zabbix Server or Proxy if the buffer is full.
    #
    # Mandatory: no
    # Range: 2-65535
    # Default:
    # BufferSize=100

    ### Option: MaxLinesPerSecond
    # Maximum number of new lines the agent will send per second to Zabbix Server
    # or Proxy processing 'log' and 'logrt' active checks.
    # The provided value will be overridden by the parameter 'maxlines',
    # provided in 'log' or 'logrt' item keys.
    #
    # Mandatory: no
    # Range: 1-1000
    # Default:
    # MaxLinesPerSecond=100

    ### Option: AllowRoot
    # Allow the agent to run as 'root'. If disabled and the agent is started by 'root', the agent
    # will try to switch to user 'zabbix' instead. Has no effect if started under a regular user.
    # 0 - do not allow
    # 1 - allow
    #
    # Mandatory: no
    # Default:
    # AllowRoot=0

    ############ ADVANCED PARAMETERS #################

    ### Option: Alias
    # Sets an alias for parameter. It can be useful to substitute long and complex parameter name with a smaller and simpler one.
    #
    # Mandatory: no
    # Range:
    # Default:

    ### Option: StartAgents
    # Number of pre-forked instances of zabbix_agentd that process passive checks.
    #
    # Mandatory: no
    # Range: 1-100
    # Default:
    # StartAgents=3

    ### Option: Timeout
    # Spend no more than Timeout seconds on processing
    #
    # Mandatory: no
    # Range: 1-30
    # Default:
    # Timeout=3

    ### Option: Include
    # You may include individual files or all files in a directory in the configuration file.
    #
    # Mandatory: no
    # Default:
    # Include=

    # Include=/etc/zabbix/zabbix_agentd.userparams.conf
    # Include=/etc/zabbix/zabbix_agentd/

    ####### USER-DEFINED MONITORED PARAMETERS #######

    ### Option: UnsafeUserParameters
    # Allow all characters to be passed in arguments to user-defined parameters.
    # 0 - do not allow
    # 1 - allow
    #
    # Mandatory: no
    # Range: 0-1
    # Default:
    # UnsafeUserParameters=0

    ### Option: UserParameter
    # User-defined parameter to monitor. There can be several user-defined parameters.
    # Format: UserParameter=<key>,<shell command>
    # Note that shell command must not return empty string or EOL only.
    # See 'zabbix_agentd' directory for examples.
    #
    # Mandatory: no
    # Default:
    # UserParameter=

    UserParameter=mysql.daily,php /etc/zabbix/mysql.php daily removed removed
    UserParameter=mysql.live,php /etc/zabbix/mysql.php live removed removed
    UserParameter=mysql.Innodb_Free,./etc/zabbix/innodb_free.sh
    Attached Files

    Comment

    • ccreamer
      Junior Member
      • Mar 2012
      • 9

      #3
      As a work around, I have changed they type of alert to Zabbix trapper and set up crontab to invoke the php script and that seems to be working for the first server. The second server I set up to do this now shows this:

      Info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.000035"

      I go to look at the data on the zabbix server and it does not display. I'm not sure what logs I should look at. Any help would really make my day. Thanks.

      Comment

      Working...