Ad Widget

Collapse

Server Availibility Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baggord
    Junior Member
    • Apr 2019
    • 15

    #1

    Server Availibility Report

    Hi,

    I'm trying to get information about when servers was down (unreachable). Agent.ping.nodata() does it's jobs and create events for us but I want to see a table with two columns for a given server (let's say server A): Time and Duration.

    I couldn't figure it out since agent.ping returns 1 only if server is up and doesn't return anything if it's not. So, default information is about when was it's up how can we reverse this and get when was it's down?

    Because consider a graph or table for a 3 months time horizon. No one can't tell when was server was down between all those agent.ping = 1 data without checking events.


    Thanks,
    - baggord.
    Last edited by baggord; 09-08-2019, 06:11.
  • baggord
    Junior Member
    • Apr 2019
    • 15

    #2
    Thanks splitek,
    I'm using 4.2 and also I have grafana integrated with Zabbix. So, what you are suggesting is that using events within the graph. Correct me if I didn't understand correctly, I'm dependent on events anyway and there is no other way to display the data of down time? Would it be bad (unnecessary) to track all servers via ICMP template?

    Comment

    • mellis
      Senior Member
      • Oct 2017
      • 145

      #3
      I wrote a simple php web page to solve this problem. it does a simple MySQL query and displays a web table. I have attached it.
      You may want to I add or remove a field but this is pretty simple stuff.

      You will see a couple includes, those are for our headed and footer on the page, you can commit them out and of course edit the host, user and password.

      Attached Files

      Comment


      • baggord
        baggord commented
        Editing a comment
        Hi @mellis,

        Many thanks for the answer and the code.
        I was away for a while, sorry for the late return. Can you explain where should I place the .php (if it matters?) and how to run it?
    • mellis
      Senior Member
      • Oct 2017
      • 145

      #4
      Because the unavailable.php creates a web page I put it under the /var/www/html folder. I created a reports folder there and have placed several queries there.

      Comment

      Working...