Actually, I found the issue.  When I removed the original graph info for 
troubleshooting sake, I removed too much.  I had also removed "online_devices" 
: {.  Once this was added back, my graphs for online devices and SINR function 
as expected.  Now I have a new issue, I am also trying to do a graph for RSRP, 
however it does not appear to handle the math correctly.  I see this link, 
https://www.mail-archive.com/[email protected]/msg01326.html with the 
same issue back in March, but I see no resolution.  Any thoughts?  See code 
below…

 

<%

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

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

%>

{

"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 %>"}}

      }

    ],

  "SINR" : [

      {

        "label" : "Good >20",

        "color" : "#5e5",

        "query" : {"summary.SINR" : {"$gt" : "<%= 19 %>"}}

      },

      {

        "label" : "Moderate 15-20",

        "color" : "#ee5",

        "query" : {"summary.SINR" : {"$lt" : "<%= 19 %>", "$gt" : "<%= 14 %>"}}

      },

      {

        "label" : "Poor <15",

        "color" : "#e55",

        "query" : {"summary.SINR" : {"$lt" : "<%= 15 %>"}}

      }

   ],

  "RSRP" : [

      {

        "label" : "Good",

        "color" : "#5e5",

        "query" : {"summary.RSRP" : {"$gt" : "<%= -100 %>"}}

      },

      {

        "label" : "Moderate",

        "color" : "#ee5",

        "query" : {"summary.RSRP" : {"$lt" : "<%= -101 %>", "$gt" : "<%= -116 
%>"}}

      },

      {

        "label" : "Poor",

        "color" : "#e55",

        "query" : {"summary.RSRP" : {"$lt" : "<%= -115 %>"}}

      }

   ]

}

}

 

Thanks.

 

From: Users [mailto:[email protected]] On Behalf Of Sergio 
Fernández
Sent: Tuesday, November 28, 2017 5:19 AM
To: Community support for GenieACS users <[email protected]>
Subject: Re: Graph help on Homepage

 

That's true. Let's wait for Zaid or another guru to enlighten us... :)

  
<https://app.contextsmith.com/track/c2VyZ2lvMTk5MzJAZ21haWwuY29t/a8f6780f2b2508b494c9dc28473f3332176732ea/spacer.gif?q=1234>
 




Sergio Fernández Rubio - https://www.linkedin.com/in/sergiofdz/


(+34) 687 016 994
CEO @ ACSdesk

https://acsdesk.com

 

2017-11-28 11:04 GMT+01:00 <[email protected] 
<mailto:[email protected]> >:

I am confused, how is what I am doing any different than what is being done in 
the “Connected Devices” graph?

 

The only real difference is that I am not declaring the validation rules 
correct?

 

From: Users [mailto:[email protected] 
<mailto:[email protected]> ] On Behalf Of Sergio Fernández
Sent: Tuesday, November 28, 2017 4:41 AM
To: Community support for GenieACS users <[email protected] 
<mailto:[email protected]> >
Subject: Fwd: Graph help on Homepage

 

In the release of v1.1.0 we can find this explanation from Zaid:



*       Presets precondition queries no longer support "$or" or other MongoDB 
logical operators.


Source: https://github.com/zaidka/genieacs/releases/tag/v1.1.0 

Zaid has given priority to Provisions and I think he removed this functionality 
in order to evade security problems. 
But when it comes to graphs on Homepage, now I don't exactly know how would I 
do what you want to perform in v1.1.



Sergio Fernández Rubio - https://www.linkedin.com/in/sergiofdz/


(+34) 687 016 994 <tel:+34%20687%2001%2069%2094> 
CEO @ ACSdesk

https://acsdesk.com

 

---------- Forwarded message ----------
From: <[email protected] <mailto:[email protected]> >
Date: 2017-11-28 10:33 GMT+01:00
Subject: Graph help on Homepage
To: Community support for GenieACS users <[email protected] 
<mailto:[email protected]> >

Ok, so I want to create a couple of graphs on the home tab.  My first is to 
show SINR levels at a glance for the connected CPEs.  For ease of 
troubleshooting, I removed the “Connected Devices” graph and just used the 
following code in graphs.json.erb,

 

{

  "SINR" : [

      {

        "label" : "Excellent",

        "color" : "#5e5",

"query" : {"InternetGatewayDevice.SystemConfig.Status.ModemStatus.RSRP" : 
{"$gt" : "<%= 24 %>"}}

      },

      {

        "label" : "Good",

        "color" : "#ee5",

"query" : {"InternetGatewayDevice.SystemConfig.Status.ModemStatus.RSRP" : 
{"$lt" : "<%= 25 %>", "$gt" : "<%= 19 %>"}}

      },

      {

        "label" : "Poor",

        "color" : "#e55",

"query" : {"InternetGatewayDevice.SystemConfig.Status.ModemStatus.RSRP" : 
{"$lt" : "<%= 20 %>"}}

      }

   ]

}

When I apply the code and attempt to access the Home tab, I get the following 
error,

undefined method `each' for nil:NilClass

 

What am I missing?  Is there another file that I need to edit?

 

Thank you.


_______________________________________________
Users mailing list
[email protected] <mailto:[email protected]> 
http://lists.genieacs.com/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[email protected] <mailto:[email protected]> 
http://lists.genieacs.com/mailman/listinfo/users

 

_______________________________________________
Users mailing list
[email protected]
http://lists.genieacs.com/mailman/listinfo/users

Reply via email to