Graphing..

Richard Verbrugge richard.verbrugge at myhighspeed.ca
Thu Dec 18 15:52:03 EST 2014


I am trying to add a graph to the into the main page and so I can write a
wiki for it too.

I tried to add the following into  genieacs-gui/config/graph.json.erb right
below the original content:

 

<%

threshold_green = (Time.now - (60 * 10))

threshold_yellow = (Time.now - (60 * 60 * 24))

threshold_slow = 1499

threshold_belowavg = 4999

threshold_aboveavg = 6999

threshold_fttn = 23999

%>

{

  "online_devices" : {

    "all_devices" : [

      {

        "label" : "Online now",

        "color" : "#5e5",

        "query" : {"_lastInform" : {"$gt" : "<%= threshold_green %>"}}

      },

      {

        "label" : "Past 24 hours",

        "color" : "#ee5",

        "query" : {"_lastInform" : {"$lt" : "<%= threshold_green %>", "$gt"
: "<%= threshold_yellow %>"}}

      },

      {

        "label" : "Others",

        "color" : "#e55",

        "query" : {"_lastInform" : {"$lt" : "<%= threshold_yellow %>"}}

      }

    ]

  }

},

{

  "online_devices" : {

    "all_devices" : [

      {

        "label" : "DSL < 1.5Mbps",

        "color" : "#c61236",

        "query" : {"summary.dsrate" : {"$lt" : "<%= threshold_green %>"}}

      },

      {

        "label" : "DSL < 5Mbps",

        "color" : "#f7a22e",

        "query" : {"summary.dsrate" : {"$lt" : "<%= threshold_belowavg %>",
"$gt" : "<%= threshold_slow %>"}}

      },

                    {

        "label" : "DSL < 7Mbps",

        "color" : "#238341",

        "query" : {"summary.dsrate" : {"$lt" : "<%= threshold_aboveavg %>",
"$gt" : "<%= threshold_belowavg %>"}}

      },

                    {

        "label" : "FTTN < 24Mbps",

        "color" : "#f7a22e",

        "query" : {"summary.dsrate" : {"$lt" : "<%= threshold_belowavg %>",
"$gt" : "<%= threshold_slow %>"}}

      },

      {

        "label" : "VDSL",

        "color" : "#123582",

        "query" : {"summary.dsrate" : {"$gt" : "<%= threshold_fttn %>"}}

      }

    ]

  }

}

But I am getting errors:

 

795: unexpected token at ', { "online_devices" : { "all_devices" : [ {
"label" : "DSL < 1.5Mbps", "color" : "#c61236", "query" : {"summary.dsrate"
: {"$lt" : "2014-12-18 13:50:40 -0500"}} }, { "label" : "DSL < 5Mbps",
"color" : "#f7a22e", "query" : {"summary.dsrate" : {"$lt" : "4999", "$gt" :
"1499"}} }, { "label" : "DSL < 7Mbps", "color" : "#238341", "query" :
{"summary.dsrate" : {"$lt" : "6999", "$gt" : "4999"}} }, { "label" : "FTTN <
24Mbps", "color" : "#f7a22e", "query" : {"summary.dsrate" : {"$lt" : "4999",
"$gt" : "1499"}} }, { "label" : "VDSL", "color" : "#123582", "query" :
{"summary.dsrate" : {"$gt" : "23999"}} } ] } } '

 

Any idea?

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20141218/b2dfd449/attachment.html>


More information about the Users mailing list