Skip to content

Commit

Permalink
fix: trim at dashboard port number in SNMP device address (#1092)
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Kheifets <[email protected]>
  • Loading branch information
ikheifets-splunk authored Oct 11, 2024
1 parent 2c9a051 commit 6343413
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 13 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/cd-dashboard-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: dashboard-release
on:
push:
tags:
- "v*"

jobs:
dashboard-release:
name: Dashboard release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Upload dashboard to release assets
run: |
VERSION=$(echo $GITHUB_REF | cut -d / -f 3)
gh release upload $VERSION dashboard/dashboard.xml
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- add support for IPv6 polling and traps for kubernetes deployment
- add support for IPv6 polling and traps for docker deployment
- add nodeSelector and podAntiAffinity to sim chart
- add support for new IP format in dashboard

### Fixed

Expand Down
24 changes: 12 additions & 12 deletions dashboard/dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<fieldForLabel>ip</fieldForLabel>
<fieldForValue>ip</fieldForValue>
<search>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;*;poll" | rex field=_raw "Sending due task sc4snmp;(?&lt;ip&gt;.+);(?&lt;num&gt;\d+);poll" | stats count by ip</query>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;*;poll" | rex field=_raw "Sending due task sc4snmp;(?&lt;ip&gt;.+):(?&lt;port&gt;\d+);(?&lt;num&gt;\d+);poll" | stats count by ip</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
</input>
<chart>
<title>In case of unsuccessful polling status, please copy spl query from this chart and find failed tasks. Explanation of error log messages you can find at the https://splunk.github.io/splunk-connect-for-snmp/main/bestpractices/</title>
<search>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" splunk_connect_for_snmp.snmp.tasks.poll $poll_status_host$ | rex field=_raw "Task splunk_connect_for_snmp.*\[*\] (?&lt;status&gt;\w+)" | where status != "received" | timechart count by status</query>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" splunk_connect_for_snmp.snmp.tasks.poll "$poll_status_host$" | rex field=_raw "Task splunk_connect_for_snmp.*\[*\] (?&lt;status&gt;\w+)" | where status != "received" | timechart count by status</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<refresh>5m</refresh>
Expand All @@ -37,7 +37,7 @@
<option name="refresh.display">progressbar</option>
<option name="trellis.enabled">0</option>
<drilldown>
<link target="_blank">search?q=index%3D*%20sourcetype%3D%22*%3Acontainer%3Asplunk-connect-for-snmp-*%22%20splunk_connect_for_snmp.snmp.tasks.poll%20$poll_status_host$%20%7C%20rex%20field%3D_raw%20%22Task%20splunk_connect_for_snmp.*%5C%5B*%5C%5D%20(%3F%3Cstatus%3E%5Cw%2B)%22%20%7C%20where%20status%20!%3D%20%22received%22&amp;earliest=-24h@h&amp;latest=now</link>
<link target="_blank">search?q=index%3D*%20sourcetype%3D%22*%3Acontainer%3Asplunk-connect-for-snmp-*%22%20splunk_connect_for_snmp.snmp.tasks.poll%20%22$poll_status_host$%22%20%7C%20rex%20field%3D_raw%20%22Task%20splunk_connect_for_snmp.*%5C%5B*%5C%5D%20(%3F%3Cstatus%3E%5Cw%2B)%22%20%7C%20where%20status%20!%3D%20%22received%22&amp;earliest=-24h@h&amp;latest=now</link>
</drilldown>
</chart>
</panel>
Expand All @@ -51,15 +51,15 @@
<fieldForLabel>ip</fieldForLabel>
<fieldForValue>ip</fieldForValue>
<search>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;*;poll" | rex field=_raw "Sending due task sc4snmp;(?&lt;ip&gt;.+);(?&lt;num&gt;\d+);poll" | stats count by ip</query>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;*;poll" | rex field=_raw "Sending due task sc4snmp;(?&lt;ip&gt;.+):(?&lt;port&gt;\d+);(?&lt;num&gt;\d+);poll" | stats count by ip</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
</input>
<chart>
<title>Using this chart you can understand when SC4SNMP scheduled polling for your SNMP device last time. The process works if it runs regularly.</title>
<search>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" Scheduler: Sending due task sc4snmp;$poll_host$;*poll | timechart count</query>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" Scheduler: Sending due task sc4snmp;*;*poll "$poll_host$" | timechart count</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<refresh>5m</refresh>
Expand All @@ -70,7 +70,7 @@
<option name="height">331</option>
<option name="refresh.display">progressbar</option>
<drilldown>
<link target="_blank">search?q=index%3D*%20sourcetype%3D%22*%3Acontainer%3Asplunk-connect-for-snmp-*%22%20Scheduler%3A%20Sending%20due%20task%20sc4snmp%3B$poll_host$%3B*poll&amp;earliest=-24h@h&amp;latest=now</link>
<link target="_blank">search?q=index%3D*%20sourcetype%3D%22*%3Acontainer%3Asplunk-connect-for-snmp-*%22%20Scheduler%3A%20Sending%20due%20task%20sc4snmp%3B*%3B*poll%20%22$poll_host$%22&amp;earliest=-24h@h&amp;latest=now</link>
</drilldown>
</chart>
</panel>
Expand All @@ -86,15 +86,15 @@
<fieldForLabel>ip</fieldForLabel>
<fieldForValue>ip</fieldForValue>
<search>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;walk" | rex field=_raw "Sending due task sc4snmp;(?&lt;ip&gt;.+);walk" | stats count by ip</query>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;walk" | rex field=_raw "Sending due task sc4snmp;(?&lt;ip&gt;.+):(?&lt;port&gt;\d+);walk" | stats count by ip</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
</input>
<chart>
<title>In case of unsuccessful walk status, please copy spl query from this chart and find failed tasks. Explanation of error log messages you can find at the https://splunk.github.io/splunk-connect-for-snmp/main/bestpractices/</title>
<search>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" splunk_connect_for_snmp.snmp.tasks.walk $walk_status_host$ | rex field=_raw "Task splunk_connect_for_snmp.*\[*\] (?&lt;status&gt;\w+)" | where status != "received" | timechart count by status</query>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" splunk_connect_for_snmp.snmp.tasks.walk "$walk_status_host$" | rex field=_raw "Task splunk_connect_for_snmp.*\[*\] (?&lt;status&gt;\w+)" | where status != "received" | timechart count by status</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<refresh>5m</refresh>
Expand All @@ -105,7 +105,7 @@
<option name="height">327</option>
<option name="refresh.display">progressbar</option>
<drilldown>
<link target="_blank">search?q=index%3D*%20sourcetype%3D%22kube%3Acontainer%3Asplunk-connect-for-snmp-*%22%20splunk_connect_for_snmp.snmp.tasks.walk%20$walk_status_host$%20%7C%20rex%20field%3D_raw%20%22Task%20splunk_connect_for_snmp.*%5C%5B*%5C%5D%20(%3F%3Cstatus%3E%5Cw%2B)%22%20%7C%20where%20status%20!%3D%20%22received%22&amp;earliest=-24h@h&amp;latest=now</link>
<link target="_blank">search?q=index%3D*%20sourcetype%3D%22kube%3Acontainer%3Asplunk-connect-for-snmp-*%22%20splunk_connect_for_snmp.snmp.tasks.walk%20%22$walk_status_host$%22%20%7C%20rex%20field%3D_raw%20%22Task%20splunk_connect_for_snmp.*%5C%5B*%5C%5D%20(%3F%3Cstatus%3E%5Cw%2B)%22%20%7C%20where%20status%20!%3D%20%22received%22&amp;earliest=-24h@h&amp;latest=now</link>
</drilldown>
</chart>
</panel>
Expand All @@ -119,15 +119,15 @@
<fieldForLabel>ip</fieldForLabel>
<fieldForValue>ip</fieldForValue>
<search>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;walk" | rex field=_raw "Sending due task sc4snmp;(?&lt;ip&gt;.+);walk" | stats count by ip</query>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" "Scheduler: Sending due task sc4snmp;*;walk" | rex field=_raw "Sending due task sc4snmp;(?&lt;ip&gt;.+):(?&lt;port&gt;\d+);walk" | stats count by ip</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
</input>
<chart>
<title>Using this chart you can understand when SC4SNMP scheduled walk for your SNMP device last time. The process works if it runs regularly.</title>
<search>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" Scheduler: Sending due task sc4snmp;$walk_host$;walk | timechart count</query>
<query>index=* sourcetype="*:container:splunk-connect-for-snmp-*" Scheduler: Sending due task sc4snmp;*;walk "$walk_host$" | timechart count</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<refresh>5m</refresh>
Expand All @@ -138,7 +138,7 @@
<option name="height">324</option>
<option name="refresh.display">progressbar</option>
<drilldown>
<link target="_blank">search?q=index%3D*%20sourcetype%3D%22*%3Acontainer%3Asplunk-connect-for-snmp-*%22%20Scheduler%3A%20Sending%20due%20task%20sc4snmp%3B$walk_host$%3Bwalk&amp;earliest=-24h@h&amp;latest=now</link>
<link target="_blank">search?q=index%3D*%20sourcetype%3D%22*%3Acontainer%3Asplunk-connect-for-snmp-*%22%20Scheduler%3A%20Sending%20due%20task%20sc4snmp%3B*%3Bwalk%20%22$walk_host$%22&amp;earliest=-24h@h&amp;latest=now</link>
</drilldown>
</chart>
</panel>
Expand Down
6 changes: 5 additions & 1 deletion docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

Using dashboard you can monitor SC4SNMP and be sure that is healthy and working correctly.


## Presetting

!!! info
Dashboard compatible with SC4SNMP 1.11+

1. [Create metrics indexes](gettingstarted/splunk-requirements.md#requirements-for-splunk-enterprise-or-enterprise-cloud) in Splunk.
2. Enable metrics logging for your runtime:
* For K8S install [Splunk OpenTelemetry Collector for K8S](gettingstarted/sck-installation.md)
Expand All @@ -13,7 +17,7 @@ Using dashboard you can monitor SC4SNMP and be sure that is healthy and working

1. In Splunk platform open **Search -> Dashboards**.
2. Click on **Create New Dashboard** and make an empty dashboard. Be sure to choose Classic Dashboards.
3. In the **Edit Dashboard** view, go to Source and replace the initial xml with the contents of [dashboard/dashboard.xml](https://github.com/splunk/splunk-connect-for-snmp/blob/main/dashboard/dashboard.xml) published in the SC4SNMP repository.
3. In the **Edit Dashboard** view, go to Source and replace the initial xml with the contents of **dashboard.xml**. This file you cand find on [release page](https://github.com/splunk/splunk-connect-for-snmp/releases) for your version in attachments.
4. Save your changes. Your dashboard is ready to use.


Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ markdown_extensions:
- codehilite
- attr_list
- md_in_html
- admonition
- pymdownx.details
- pymdownx.superfences

plugins:
- search:
Expand Down

0 comments on commit 6343413

Please sign in to comment.