-
Notifications
You must be signed in to change notification settings - Fork 2
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
an alternative query #8
Comments
Hi @r2evans This looks very interesting, of course this helps. Databases are not so much my expertise, so every input is appreciated, thanks for that. I try to use it and to better my script. Is this started in sqlite3 or part of script? Regards |
I wanted to remind you that
It's true json (a complete list), not ndjson (newline-delimited json). |
Again, thanks for your input... Already played with it. But it will be a little time for me to get it running, but I'm already working on it... |
In work |
Hi, thanks again for your help. I've just published my new PRTG script. I could also used most of your query. |
This doesn't produce XML, but I was inspired by your repo to form my own single-query for much of the same information. When connected to the
config.db
file, we can attach theactivity.db
(assuming current-directory here) to get to the other tables in the same command.This saves repeated calls to
sqlite3
, and while repeated calls is likely performant enough, I thought it might be good (and/or useful) to unify it into a singleselect
statement.Output (de-PII-ized):
While my use is for a simple ssh console output, the method could easily be adapted to produce XML instead of the above tabular format.
rdt.log_type='1111'
relates to thelt.log_type
formats I added here; most of thatcase when
onlt.log_type
may never be used, but I keep it as built-in documentation. (I found the meanings by comparing the timestamps with my Syno ABB log output. Imperfect.)jq
).rt.task_config
conditional a bit more specific, guarding against false-joins on pattern matching.rn
is simply to return the last few rows for eachdevice_id
, I wanted a simple history/trend.left join
versusinner join
gives us the empty rows where ABB is showing "nothing recent". (ABB Portal may still offer restoration options for those.)I started mapping out the databases so that I could better understand the joins.
This is far from complete and would benefit from completing the links of foreign keys (and it does not attempt to differentiate between
config.db
-vs-activity.db
, they appear to be "all the same db" after theattach database...
above.This can be "played with" using https://sql.toad.cz, clicking on "Save / Load", pasting the below text into the "Input/Output" text-input, then clicking "LOAD XML".
schema xml
Offered solely as a "hope it helps".
The text was updated successfully, but these errors were encountered: