Ad Widget

Collapse

Help With Items / Triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tlawler
    Junior Member
    • Sep 2014
    • 2

    #1

    Help With Items / Triggers

    Hello,

    Long time lurker & viewer. I appreciate all of the invaluable knowledge available on this forum.

    Admittedly I am very new to Zabbix, and would appreciate some help creating a new trigger.

    We have a database that tracks the number of available phone numbers within our web application that I would like to monitor. For example if the number of available number falls below a set value we would get alerted, so we could address this issue accordingly.

    I can run a simple query that produces the results of available numbers:

    For the available local number that have toll-free numbers:
    SELECT *
    FROM inboundfaxdid
    WHERE organizationid is null
    AND faxdid is not null and tollfreedid is not null
    ORDER BY faxdidid

    We are running version 1.8.2 of Zabbix. Any and all help is appreciated! We currently don't have anyone who is familiar with Zabbix in the company, so we are lost on this one.

    Thanks!
  • coreychristian
    Senior Member
    Zabbix Certified Specialist
    • Jun 2012
    • 159

    #2
    Not knowing the type of database will limit the help a bit.

    Essentially you will need to perform the following.

    Write a script (or figure out a command) that outputs the count of the results returned. You can update your query to just output the count by doing "SELECT count(*) FROM inboundfaxdid WHERE organizationid is null AND faxdid is not null and tollfreedid is not null"

    Once you have the script created, you have a few options.

    1. Schedule the script to run, and use zabbix_sender to populate a zabbix trapper item (or external item if you want the script to run from the zabbix server, personally I wouldn't suggest this method).
    2. Add the script as a user parameter and then add that user parameter to the host in zabbix.
    3. Have the script output to a log file, then monitor that log file

    There are probably a few other methods of getting the data into zabbix, the above would likely be the easiest though.




    Those links should help you get on the correct track as well.

    Comment

    • tlawler
      Junior Member
      • Sep 2014
      • 2

      #3
      Originally posted by coreychristian
      Not knowing the type of database will limit the help a bit.

      Essentially you will need to perform the following.

      Write a script (or figure out a command) that outputs the count of the results returned. You can update your query to just output the count by doing "SELECT count(*) FROM inboundfaxdid WHERE organizationid is null AND faxdid is not null and tollfreedid is not null"

      Once you have the script created, you have a few options.

      1. Schedule the script to run, and use zabbix_sender to populate a zabbix trapper item (or external item if you want the script to run from the zabbix server, personally I wouldn't suggest this method).
      2. Add the script as a user parameter and then add that user parameter to the host in zabbix.
      3. Have the script output to a log file, then monitor that log file

      There are probably a few other methods of getting the data into zabbix, the above would likely be the easiest though.




      Those links should help you get on the correct track as well.
      Thank you for the reply! I will give your suggestion a try!

      Comment

      Working...