-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add SNMP Monitor #4717
feat: Add SNMP Monitor #4717
Conversation
This commit introduces a new SNMP monitor feature to the application, allowing users to monitor devices using SNMP (Simple Network Management Protocol).
net-snmp over snmp-native is: -more robust -more popular -better documented -supports v3
Further testing of SNMP feat, however I'm running into the issue `Error in SNMP check: RequestTimedOutError: Request timed out` when the check function is called. I am unsure as to why since my local SNMP script works great with very similar code.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks for pointing it out @CommanderStorm!
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
DB must allow nulls otherwise this will break other monitors.
knex requires down function
Updates appropriate values async when editing the SNMP monitor
@CommanderStorm I'm ready for review. It is not passing ES Lint, although when I run |
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-Authored-By: Frank Elsinga <frank.elsinga@tum.de>
Co-Authored-By: Frank Elsinga <frank.elsinga@tum.de>
Just to be absolutely sure this feat is ready to ship from my perspective, I tested many scenarios for both the SNMP and JSON Query monitor types. I tested various edge cases and went through each condition ( In the spoiler below is a table with most of the scenarios, and how the console displays the UP/DOWN status:
|
Hey @chakflying wondering if you'd be willing to take a look at this again? |
Any news on this? Really looking forward to it. 😄 |
No news yet but if you're able to help test I would appreciate it. You can spin up your own Docker instance of this PR with
|
When I try to deploy it, it gives an error. Where it says is has no access to /data/upload. Do you know what that means? If I don't setup a persistent directory on /app/data, the database-setup page stays blank. Could just be me being dumb, but I don't understand what's going on. 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested working, I'm okay with this. Great work.
Not familiar with this at all but I'm guessing more work will be required if we want to support table data in future?
It would be simple enough to return the raw SNMP value from Can you reference a PR so I can better understand what you mean by "table data"? |
Thanks for the new monitor! 🎉 Note This PR is part of the All changes in this PR are small and uncontroversial ⇒ merging with junior maintainer approval |
@mattv8, how can I test this? Will it only be released with v2? |
Try this: git clone https://github.com/louislam/uptime-kuma.git # Assuming you have git installed cd uptime-kuma # Change into the directory you just cloned git fetch origin pull/4717/head:pr-4717 && git checkout pr-4717 # Check out this PR npm ci # Assuming you have node and npm installed npm run dev # This will start the server on http://localhost:3000 |
@mattv8 Hey how can I try this release with SNMP support if i'm already running v 1.23.13? |
V2.0 is currently not released. Please see #4500 for further details on the bugs that need fixing. |
Tick the checkbox if you understand [x]:
Description (Updated 06 June 2024 to reflect new scope)
This PR introduces a new SNMP monitor type and extends the functionality of JSON query monitoring with additional comparison operators. The following changes have been made:
Uptime Kuma Core
evaluateJsonQuery(data: any, jsonPath: string, jsonPathOperator: string, expectedValue: any)
, which returns{ status: boolean, response: any }
wherestatus
is the UP/DOWN evaluation andresponse
is the result of the JSON query evaluation.New SNMP Monitor Type:
evaluateJsonQuery()
to determine monitor status based on SNMP values and configured conditions.JSON Query Monitoring:
evaluateJsonQuery()
to determine monitor status based on JSON query evaluation and configured conditions.==
,!=
,<
,<=
,>
,>=
).==
if the operator is not specified in existing configurations.Resolves #1675
Resolves #4715
Resolves #4614
Resolves #4617
Type of change
Please delete any options that are not relevant.
Checklist
Screenshots