forked from prometheus/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5483a4
commit 11375a5
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{ template "head" . }} | ||
|
||
{{ template "prom_content_head" . }} | ||
<h1>SNMP Device Overview - {{ .Params.instance }}</h1> | ||
|
||
<table class="table table-condensed table-striped table-bordered" style="width: 0%"> | ||
<tr> | ||
<th>Port</th> | ||
<th>Status</th> | ||
<th>Speed</th> | ||
<th>In</th> | ||
<th>Out</th> | ||
<th>Discards</th> | ||
<th>Errors</th> | ||
</tr> | ||
{{ range query (printf "ifOperStatus{job='snmp',instance='%s'}" .Params.instance) | sortByLabel "ifDescr" }} | ||
<tr> | ||
<td class="text-right">{{ .Labels.ifDescr }}</a></td> | ||
<td class="text-right {{ if eq (. | value) 1.0 }}success">up | ||
{{ else if eq (. | value) 2.0}}">down | ||
{{ else if eq (. | value) 3.0}}">testing | ||
{{ else if eq (. | value) 4.0}}">unknown | ||
{{ else if eq (. | value) 5.0}}">dormant | ||
{{ else if eq (. | value) 6.0}}">notPresent | ||
{{ else if eq (. | value) 7.0}}">lowerLayerDown | ||
{{else}}">{{ end }}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "ifHighSpeed{job='snmp',instance='%s',ifDescr='%s'} * 1e6 or ifSpeed{job='snmp',instance='%s',ifDescr='%s'}" .Labels.instance .Labels.ifDescr .Labels.instance .Labels.ifDescr) "b/s" "humanize")}}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "rate(ifHCInOctets{job='snmp',instance='%s',ifDescr='%s'}[5m]) * 8 or rate(ifInOctets{job='snmp',instance='%s',ifDescr='%s'}[5m]) * 8" .Labels.instance .Labels.ifDescr .Labels.instance .Labels.ifDescr) "b/s" "humanize")}}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "rate(ifHCOutOctets{job='snmp',instance='%s',ifDescr='%s'}[5m]) * 8 or rate(ifOutOctets{job='snmp',instance='%s',ifDescr='%s'}[5m]) * 8" .Labels.instance .Labels.ifDescr .Labels.instance .Labels.ifDescr) "b/s" "humanize")}}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "rate(ifInDiscards{job='snmp',instance='%s',ifDescr='%s'}[5m]) + rate(ifOutDiscards{job='snmp',instance='%s',ifDescr='%s'}[5m]) * 8" .Labels.instance .Labels.ifDescr .Labels.instance .Labels.ifDescr) "/s" "humanizeNoSmallPrefix")}}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "rate(ifInErrors{job='snmp',instance='%s',ifDescr='%s'}[5m]) + rate(ifOutErrors{job='snmp',instance='%s',ifDescr='%s'}[5m]) * 8" .Labels.instance .Labels.ifDescr .Labels.instance .Labels.ifDescr) "/s" "humanizeNoSmallPrefix")}}</td> | ||
</tr> | ||
{{ end }} | ||
{{ template "prom_content_tail" . }} | ||
|
||
{{ template "tail" }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{{ template "head" . }} | ||
|
||
{{ template "prom_right_table_head" }} | ||
<tr> | ||
<th>SNMP</th> | ||
<th>{{ template "prom_query_drilldown" (args "sum(up{job='snmp'})") }} / {{ template "prom_query_drilldown" (args "count(up{job='snmp'})") }}</th> | ||
</tr> | ||
{{ template "prom_right_table_tail" }} | ||
|
||
{{ template "prom_content_head" . }} | ||
<h1>SNMP</h1> | ||
|
||
<table class="table table-condensed table-striped table-bordered" style="width: 0%"> | ||
<tr> | ||
<th>Device</th> | ||
<th>Up</th> | ||
<th>Ports Up</th> | ||
<th>Ports Total</th> | ||
<th>In</th> | ||
<th>Out</th> | ||
<th>Discards</th> | ||
<th>Errors</th> | ||
</tr> | ||
{{ range query "up{job='snmp'}" | sortByLabel "instance" }} | ||
<tr> | ||
<td><a href="snmp-overview.html?instance={{ .Labels.instance }}">{{ .Labels.instance }}</a></td> | ||
<td {{ if eq (. | value) 1.0 }}>Yes{{ else }} class="alert-danger">No{{ end }}</td> | ||
<td class="text-right">{{ query (printf "ifOperStatus{job='snmp',instance='%s'} == 1" .Labels.instance) | len }}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "count(ifOperStatus{job='snmp',instance='%s'})" .Labels.instance) ) }}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "8 * sum by (instance)(rate(ifHCInOctets{job='snmp',instance='%s'}[5m]) or rate(ifInOctets{job='snmp',instance='%s'}[5m]))" .Labels.instance .Labels.instance) "b/s" "humanize")}}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "8 * sum by (instance)(rate(ifHCOutOctets{job='snmp',instance='%s'}[5m]) or rate(ifOutOctets{job='snmp',instance='%s'}[5m]))" .Labels.instance .Labels.instance) "b/s" "humanize")}}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "8 * sum by (instance)(rate(ifInDiscards{job='snmp',instance='%s'}[5m]) or rate(ifOutDiscards{job='snmp',instance='%s'}[5m]))" .Labels.instance .Labels.instance) "/s" "humanizeNoSmallPrefix")}}</td> | ||
<td class="text-right">{{ template "prom_query_drilldown" (args (printf "8 * sum by (instance)(rate(ifInErrors{job='snmp',instance='%s'}[5m]) or rate(ifOutErrors{job='snmp',instance='%s'}[5m]))" .Labels.instance .Labels.instance) "/s" "humanizeNoSmallPrefix")}}</td> | ||
</tr> | ||
{{ else }} | ||
<tr><td colspan=4>No devices found.</td></tr> | ||
{{ end }} | ||
|
||
{{ template "prom_content_tail" . }} | ||
|
||
{{ template "tail" }} |