Synology NAS Dashboard

Hi there. I wonder if anyone can help. I am trying to query data for the interface and I am successful when querying ifAdminStatus{job=~‘synologynas’,instance=~‘172.18.0.10’}

but when I run this query I get no data.

count(ifAdminStatus{job=~‘synologynas’,instance=~‘172.18.0.10’,ifName=~‘()’}==2)

Can anyone tell me what I need to do to get data from the above query.

UPDATE: so i figured out its something to do with the ifName. How do I get prometheus to get that metric?

You will find tons of example on the web and on this forum on how to get what you need. Check this one example

2 Likes

Thanks man!

1 Like

Unfortunately most of these tutorials involve docker. I am not using a docker container, just the snmp exporter and prometheus server on a Ubuntu Virtual machine. I think the problem lies in the generator.yml file and I don’t know what to put in there to get my network interfaces showing. I already tried to walk: interfaces and I used the ifTable and ifXTable OID’s and can successfully walk these metrics, there just not showing up in Prometheus.

1 Like

Disregard the docker sfuff, it’s just containerization

What config yaml is the exporter using in prometheus

is synology ip address configured as one of the targets in prometheus?

its using generator.yml

Here is the contents,

 auths:
   public_v1:
     version: 1
   public_v2:
     version: 2
 
 modules:
   # Default IF-MIB interfaces table with ifIndex.
   if_mib:
     walk: 
       - 1.3.6.1.2.1.31.1.1
       - 1.3.6.1.2.1.2.2
       - sysUpTime
       - interfaces
       - ifXTable
     lookups:
       - source_indexes: [ifIndex]
         lookup: ifAlias
       - source_indexes: [ifIndex]
         # Uis OID to avoid conflict with PaloAlto PAN-COMMON-MIB.
         lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr
       - source_indexes: [ifIndex]
         # Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
         lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
     overrides:
       ifAlias:
         ignore: true # Lookup metric
       ifDescr:
         ignore: true # Lookup metric
       ifName:
         ignore: true # Lookup metric
       ifType:
         type: EnumAsInfo
   synology:
     walk:
       - laNames
       - laLoadInt
       - ssCpuUser
       - ssCpuSystem
       - ssCpuIdle
       - 1.3.6.1.4.1.6574.1       # synoSystem
       - 1.3.6.1.4.1.6574.2       # synoDisk
       - 1.3.6.1.4.1.6574.3       # synoRaid
       - 1.3.6.1.4.1.6574.4       # synoUPS
       - 1.3.6.1.4.1.6574.5       # synologyDiskSMART
       - 1.3.6.1.4.1.6574.6       # synologyService
       - 1.3.6.1.4.1.6574.101     # storageIO
       - 1.3.6.1.4.1.6574.102     # spaceIO
       - 1.3.6.1.4.1.6574.104     # synologyiSCSILUN
       - 1.3.6.1.2.1.2
       - 1.3.6.1.2.1.25.2
       - 1.3.6.1.2.1.31.1.1
       - 1.3.6.1.4.1.2021.10.1.2
       - 1.3.6.1.4.1.2021.10.1.5
       - 1.3.6.1.4.1.2021.4
     lookups:
       - source_indexes: [spaceIOIndex]
         lookup: spaceIODevice
         drop_source_indexes: true
       - source_indexes: [storageIOIndex]
         lookup: storageIODevice
         drop_source_indexes: true
       - source_indexes: [serviceInfoIndex]
         lookup: serviceName
         drop_source_indexes: true
       - source_indexes: [diskIndex]
         lookup: diskID
         drop_source_indexes: true
       - source_indexes: [raidIndex]
         lookup: raidName
         drop_source_indexes: true
       - source_indexes: [laIndex]
         lookup: laNames
         drop_source_indexes: true
       - source_indexes: [ifIndex]
         lookup: ifAlias
       - source_indexes: [ifIndex]
         # Uis OID to avoid conflict with PaloAlto PAN-COMMON-MIB.
         lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr
       - source_indexes: [ifIndex]
         # Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
         lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
       - source_indexes: [ifIndex]
         lookup: ifName
 
     overrides:
       ifAlias:
         ignore: true # Lookup metric
       ifDescr:
         ignore: true # Lookup metric
       ifName:
         ignore: true # Lookup metric
       ifType:
         type: EnumAsInfo
       diskModel:
         type: DisplayString
       diskSMARTAttrName:
         type: DisplayString
       diskSMARTAttrStatus:
         type: DisplayString
       diskSMARTInfoDevName:
         type: DisplayString
       diskType:
         type: DisplayString
       modelName:
         type: DisplayString
       raidFreeSize:
         type: gauge
       raidName:
         type: DisplayString
       raidTotalSize:
         type: gauge
       serialNumber:
         type: DisplayString
       serviceName:
         type: DisplayString
       version:
         type: DisplayString
1 Like

Yes the ip is one of the targets. I have most of the dashboard working, there are just a few panels that are not receiving data. Here is the output of the Grafana Query Inspector

Object
traceId:undefined
request:Object
url:“api/ds/query?ds_type=prometheus&requestId=Q27129”
method:“POST”
data:Object
queries:Array[3]
from:“1708553326707”
to:“1708564126708”
hideFromInspector:false
response:Object
results:Object
A:Object
B:Object
C:Object

{
“request”: {
“url”: “api/ds/query?ds_type=prometheus&requestId=Q27145”,
“method”: “POST”,
“data”: {
“queries”: [
{
“exemplar”: true,
“expr”: “count(ifAdminStatus{job=~‘synologynas’,instance=~‘172.18.0.10’,ifName=~‘()’}==1)”,
“instant”: true,
“interval”: “”,
“legendFormat”: “Admin Up”,
“refId”: “A”,
“datasource”: {
“type”: “prometheus”,
“uid”: “e672a368-09fc-471a-b842-83c6090be488”
},
“requestId”: “1445A”,
“utcOffsetSec”: -18000,
“datasourceId”: 1,
“intervalMs”: 15000,
“maxDataPoints”: 848
},
{
“exemplar”: true,
“expr”: “count(ifAdminStatus{job=~‘synologynas’,instance=~‘172.18.0.10’,ifName=~‘()’}==2)”,
“hide”: false,
“instant”: true,
“interval”: “”,
“legendFormat”: “Admin Down”,
“refId”: “B”,
“datasource”: {
“type”: “prometheus”,
“uid”: “e672a368-09fc-471a-b842-83c6090be488”
},
“requestId”: “1445B”,
“utcOffsetSec”: -18000,
“datasourceId”: 1,
“intervalMs”: 15000,
“maxDataPoints”: 848
},
{
“exemplar”: true,
“expr”: “(count(ifOperStatus{job=~‘synologynas’,instance=~‘172.18.0.10’,ifName=~‘()’}==2)) - (count(ifAdminStatus{job=~‘synologynas’,instance=~‘172.18.0.10’,ifName=~‘()’}==2))”,
“hide”: false,
“instant”: true,
“interval”: “”,
“legendFormat”: “DOWN”,
“refId”: “C”,
“datasource”: {
“type”: “prometheus”,
“uid”: “e672a368-09fc-471a-b842-83c6090be488”
},
“requestId”: “1445C”,
“utcOffsetSec”: -18000,
“datasourceId”: 1,
“intervalMs”: 15000,
“maxDataPoints”: 848
}
],
“from”: “1708553776394”,
“to”: “1708564576395”
},
“hideFromInspector”: false
},
“response”: {
“results”: {
“A”: {
“status”: 200,
“frames”: ,
“refId”: “A”
},
“B”: {
“status”: 200,
“frames”: ,
“refId”: “B”
},
“C”: {
“status”: 200,
“frames”: ,
“refId”: “C”
}
}
}
}

Can you explore data and see that label?

which label?

IfName

Can you try running tjese queries each by themselves first

job=~‘synologynas’
instance=~‘172.18.0.10’
ifName=~‘()’ → ???

I get a parse error when running these queries