Chart or graph example for 1.2 that anypne would like to share

Hi All,

I would like to add a few charts to the overview page but i am looking for some examples of the syntax. e.g for software versions on connected CPEs

Can anyone post some snippets the dont ming sharing?

Thanks

Showing a breakdown of the software versions will require a lot of manual work on your part. To the best of my knowledge, there really isn’t a way to group/count via a generic query.

Here is an example of some graphs we have:

Here is the relevant code (This works in v1.1, we haven’t upgraded to v1.2 yet so I cannot guarantee that things work the same way in v1.2).

  "online_past_24_hours": {
    "model" : [
      {
        "label" : "SmartRG 360",
        "color" : "#640264",
        "query" : {"VirtualParameters.Model" : "SR360n", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      },
      {
        "label" : "SmartRG 510",
        "color" : "#c58744",
        "query" : {"VirtualParameters.Model" : "SR510N", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      },
      {
        "label" : "SmartRG 515",
        "color" : "#fc6604",
        "query" : {"VirtualParameters.Model" : "SR515ac", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      },
      {
        "label" : "SmartRG 516",
        "color" : "#fcfe04",
        "query" : {"VirtualParameters.Model" : "SR516ac", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      },
      {
        "label" : "SmartRG 552",
        "color" : "#040163",
        "query" : {"VirtualParameters.Model" : "SR552n", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      },
      {
        "label" : "SmartRG 555",
        "color" : "#44b3c2",
        "query" : {"VirtualParameters.Model" : "SR555ac", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      }
    ],
    "mode" : [
      {
        "label" : "Routed",
        "color" : "#44b3c2",
        "query" : {"_tags" : "Managed", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      },
      {
        "label" : "Bridged",
        "color" : "#c58744",
        "query" : {"_tags" : "Bridged", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      }
    ],
    "access" : [
      {
        "label" : "Ethernet",
        "color" : "#44b3c2",
        "query" : {"VirtualParameters.WANAccessType" : "Ethernet", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      },
      {
        "label" : "DSL",
        "color" : "#fc6604",
        "query" : {"VirtualParameters.WANAccessType" : "DSL", "_lastInform" : {"$gt" : "<%= previous_24_hours %>"}}
      }
    ]
  },

I can share simple v1.2 example. Mostly I use “=” conditions. This sample means:
1: if value exist and equal 192.168.1.1
2: if value exist but not equal 192.168.1.1
3: if value do not exist

def_lan:
label: “‘Default LAN’”
slices:
1_def_lan:
color: “‘#99ccff’”
filter: Device.IP.Interface.1.IPv4Address.1.IPAddress = “192.168.1.1”
label: “‘Def_LAN’”
2_custom:
color: “‘#003366’”
filter: Device.IP.Interface.1.IPv4Address.1.IPAddress <> “192.168.1.1”
label: “‘Custom_LAN’”
3_blank_lan:
color: “‘#a945ff’”
filter: Device.IP.Interface.1.IPv4Address.1.IPAddress IS NULL
label: “‘Blank_LAN’”

Thank you vytasu. that got me somehwre but YAML logic eludes me still.

See the following.

firmware:
label: “‘Firmware Versions’”
slices:
1_def_lan:
color: “‘#99ccff’”
filter: Device.DeviceInfo.SoftwareVersion = “6.47”
label: “‘6.47’”
2_custom:
color: “‘#003366’”
filter: Device.DeviceInfo.SoftwareVersion = “6.45.9”
label: “‘6.45.9’”
3_blank_lan:
** color: “‘#a945ff’”**
** filter: (Device.DeviceInfo.SoftwareVersion NOT LIKE “6.45.9”) OR**
** (Device.DeviceInfo.SoftwareVersion NOT LIKE “6.47”)**
** label: “‘Other’”**

the OR is getting me

If you want other than these two, try this logic:

filter: NOT (Device.DeviceInfo.SoftwareVersion = “6.47” OR Device.DeviceInfo.SoftwareVersion = “6.45.9”)

That worked beautifully. Thank you.