Ad Widget

Collapse

How to get current SLA (not Acceptable SLA) of IT Service by time period via SQL?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michael0
    Member
    • Jan 2013
    • 70

    #16
    hmm I copied it from the first page, but when I correct it to "params" I get the same error message back.

    Could you please explain to me the "from" and "to" value?

    Which format is this? day,month,hours etc..?

    Maybe its just the wrong intervall

    Comment

    • romale
      Member
      • Mar 2013
      • 53

      #17
      Originally posted by Michael0
      hmm I copied it from the first page, but when I correct it to "params" I get the same error message back.

      Could you please explain to me the "from" and "to" value?

      Which format is this? day,month,hours etc..?

      Maybe its just the wrong intervall
      it's timestamp format (unix ticks).
      use this online conversion tool to convert human dates to unix timestamp


      but in your case, use this command (pls check and format code):
      curl -X POST -H 'Content-Type: application/json-rpc' -d '{"auth":"fd011c9455688c8f1274942c94aaea5d","param s":{"serviceids":"199","intervals":[{"from":"1352452201","to":"1353057001"}]},"jsonrpc":"2.0","method":"service.getsla","id" :1 }' http://localhost/zabbix/api_jsonrpc.php
      Last edited by romale; 05-06-2013, 14:05.

      Comment

      • Michael0
        Member
        • Jan 2013
        • 70

        #18
        Thank you for the link!

        Now it works, I just saw that I missed one " before the intervall value.

        So now I get this back:

        {"jsonrpc":"2.0","result":{"199":{"status":"0","pr oblems":[],"sla":[{"from":"1367366400","to":"1369958400","sla":100," okTime":2469600,"problemTime":0,"downtimeTime":122 400}]}},"id":1}[root@hostname api]#

        But when I want to convert the "okTime" to human readable, I get this back from the calculator:

        Thu, 29 Jan 1970 14:00:00 GMT

        I wanted to use the API because of this problem:



        I need a correct SLA calculation, thats why I wanted to check if the API is reporting me back the correct calculations...

        I´m a little bit out of ideas how I can get correct SLA statistics

        Comment

        • romale
          Member
          • Mar 2013
          • 53

          #19
          Originally posted by Michael0
          Thank you for the link!
          But when I want to convert the "okTime" to human readable, I get this back from the calculator:

          Thu, 29 Jan 1970 14:00:00 GMT
          okTime it's seconds. Just divide it by 60 and you'll get minutes etc
          Last edited by romale; 05-06-2013, 15:00.

          Comment

          • Michael0
            Member
            • Jan 2013
            • 70

            #20
            ok thank you, now I can work with zabbix api, but my problem is still the same.

            IT service last 7 days:



            output from api:

            {"jsonrpc":"2.0","result":{"249":{"status":"0","pr oblems":[],"sla":[{"from":"1369785600","to":"1370390400","sla":82.5, "okTime":237600,"problemTime":50400,"downtimeTime" :316800}]}},"id":1}[root@hostname api]

            so the calculation is for both correct, but I don´t know were the problem time comes from....

            Comment

            Working...