Is this possible? Store data from Asus Router ajax .asp page for Temperature data.
-
OK, but the target variable shown there is different from the one used in the expressions...
RouterMemoryResponse
vsRouterMemoryRaw
That's because I just renamed the global expression to see if that made any difference.
-
Sorry, but let's stick with one issue at a time, please.
I want to see if that Expressions page view is actually broken and not showing complete/valid data. Make a dummy rule that contains a variable expression condition using the free memory value, and show what that displays for "current value" in both the rule editor and in the rule status view.
-
Can you make sure
RouterMemoryResponse
is defined before the other two variables in the list, restart MSR and check again. -
And the rule?
-
And the rule?
-
OK. In
RouterMemoryFree
expression remove all of the(\\d+)
strings so that the middle/second argument tomatch()
is just"Mem:"
by itself (no spaces or other data). Restart and hard refresh. Then re-check. -
Yes, that's fine.
-
OK. So your pattern isn't matching, it seems is actually the problem. You may have some special characters or strange spacing in your pattern that I cannot see in the screen shots. There could also be a tab or other non-space character that looks like a space coming back in the shell command output.
Try using this expression for
RouterMemoryFree
:match( RouterMemoryResponse, "Mem: (\\d+) (\\d+) (\\d+)", 3 )
-
-
OK. Try changing all of the spaces to
\\s*
like this:match( RouterMemoryResponse, "Mem:\\s*(\\d+)\\s*(\\d+)\\s*(\\d+)", 3 )
-
OK. Try changing all of the spaces to
\\s*
like this:match( RouterMemoryResponse, "Mem:\\s*(\\d+)\\s*(\\d+)\\s*(\\d+)", 3 )
@toggledbits That seems to work.
-
OK. So your router must be returning some space-looking character that isn't space in the string somewhere. That's fine... the
\\s
means match anything that looks like a space. That's your path forward.