Skip to content
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

Make compatible with ROS 7 #2

Open
dh3wr opened this issue Dec 5, 2023 · 1 comment
Open

Make compatible with ROS 7 #2

dh3wr opened this issue Dec 5, 2023 · 1 comment

Comments

@dh3wr
Copy link

dh3wr commented Dec 5, 2023

The download-URL from the mikrotik-server seems to work only wiht the version 6.x branch. With ROS 7, I could not find the corresponding URL to get the current version released. Anybody has a hint which URL to parse?

@adydeac
Copy link

adydeac commented Sep 8, 2024

Hi!
I've fixed this issue by hacking the NS record of the download url. Here is my diff:

diff --git a/check_Mikrotik_OS.py b/check_Mikrotik_OS.py
index de8514f..7f0d77c 100755
--- a/check_Mikrotik_OS.py
+++ b/check_Mikrotik_OS.py
@@ -16,7 +16,8 @@ OID_CurrentFirmwareVersion = '.1.3.6.1.4.1.14988.1.1.7.4.0'  # Current RouterOS
 #MIKROTIK-MIB::mtxrFirmwareUpgradeVersion.0
 OID_LatestFirmwareVersion = '.1.3.6.1.4.1.14988.1.1.7.7.0'  # Latest availble RouterOS Firmware Version
 
-baseURLS = {"https://download.mikrotik.com/", "https://upgrade.mikrotik.com/" }
+#baseURLS = {"https://download.mikrotik.com/", "https://upgrade.mikrotik.com/" }
+baseURLS = { "https://upgrade.mikrotik.com/" }
 debug = False;
 
 def nagios_exit(overallStatus, message):
@@ -53,9 +54,9 @@ def getLatestMikrotik(ReleaseChannel):
diff --git a/check_Mikrotik_OS.py b/check_Mikrotik_OS.py
index de8514f..7f0d77c 100755
--- a/check_Mikrotik_OS.py
+++ b/check_Mikrotik_OS.py
@@ -16,7 +16,8 @@ OID_CurrentFirmwareVersion = '.1.3.6.1.4.1.14988.1.1.7.4.0'  # Current RouterOS
 #MIKROTIK-MIB::mtxrFirmwareUpgradeVersion.0
 OID_LatestFirmwareVersion = '.1.3.6.1.4.1.14988.1.1.7.7.0'  # Latest availble RouterOS Firmware Version
 
-baseURLS = {"https://download.mikrotik.com/", "https://upgrade.mikrotik.com/" }
+#baseURLS = {"https://download.mikrotik.com/", "https://upgrade.mikrotik.com/" }
+baseURLS = { "https://upgrade.mikrotik.com/" }
 debug = False;
 
 def nagios_exit(overallStatus, message):
@@ -53,9 +54,9 @@ def getLatestMikrotik(ReleaseChannel):
         # supplied release channel.
 
         # Define URLS.  (Note that only RouterOS V6 is currently supported.
-        currentURL = "routeros/LATEST.6"
-        bugFixOnlyURL = "routeros/LATEST.6fix"
-        RCURL = "routeros/LATEST.6rc"
+        currentURL = "routeros/NEWESTa7.stable"
+        bugFixOnlyURL = "routeros/NEWESTa7.testing"
+        RCURL = "routeros/NEWESTa7.development"
 
         if ReleaseChannel == "Current":
             URL = EachBaseURL + currentURL
@@ -204,7 +205,7 @@ def main():
         now = datetime.datetime.now()
         dateofLastRelease = datetime.datetime.fromtimestamp(float(LatestRouterOSVersion_ReleaseDate))
         delta = now - dateofLastRelease
-        RouterOSMessage = "Router upgrade from " + CurrentRouterOsVerion + " to " + LatestRouterOSVersion + " is required"
+        RouterOSMessage = "Router upgrade from " + CurrentRouterOsVerion + " to " + LatestRouterOSVersion + " is required."
         if delta.days < 7:
             RouterOSStatus = 'Warning'
         else:
@@ -214,10 +215,11 @@ def main():
 
     if OutOfDate(CurrentFirmwareVersion, LastestFirmwareVersion):
         firmwareMessage = "Firmware Requires Upgrade (" + CurrentFirmwareVersion + " -> " + LastestFirmwareVersion + ")."
-        firmwareStatus = "Critical"
+#        firmwareStatus = 'Warning'
+        firmwareStatus = 'Ok'
     else:
         firmwareMessage = "Firmware is up to date (" + CurrentFirmwareVersion + ")."
-        firmwareStatus = "Ok"
+        firmwareStatus = 'Ok'
 
     # Figure out overall status
 

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants