wadama / nas_ab_status Goto Github PK
View Code? Open in Web Editor NEWBash script for monitoring status of device backup in Synology Active Backup for Business in PRTG
License: GNU General Public License v3.0
Bash script for monitoring status of device backup in Synology Active Backup for Business in PRTG
License: GNU General Public License v3.0
Hi,
thanks for the scripts.
We are successfully monitoring the Backup Status of Clients which are in the "PC" and "Physical Server" Group of Active Backup for Business.
Once adding a new sensor which is using the Task List of the "Virtual Machine" Group it fails with "No result or error in XML response" in PRTG.
Error Logging
/var/prtg/scriptsxml/nas_ab_status_m.sh: line 22: [: too many arguments
/var/prtg/scriptsxml/nas_ab_status_m.sh: line 32: 1617003892 2|11|VM|70915194880|1617000491|1617001668 2|12|VM1|47917826048|1617001670|1617002639 2|13|VM02|28607250432|1617002640|1617003470 2|14|VM02|50050629632|1617003471|1617004533 2|15|VM05|30224154624|1617003893|1617004610 - 1617000491: syntax error in expression (error token is "2|11|VM01|70915194880|1617000491|1617001668 2|12|VM04|47917826048|1617001670|1617002639 2|13|VM06|28607250432|1617002640|1617003470 2|14|VM07|50050629632|1617003471|1617004533 2|15|V3820008|30224154624|1617003893|1617004610 - 1617000491")
Task VM_BACKUP: VM01 VM02
best
Hello,
When I run the command chmod +x nas_ab_status(_m).sh I get the following error. How can I fix this -sh: syntax error with unexpected token `('
Would it be possible to have a check if a running backup is active to avoid getting the Warning by lookup value 'Undefined lookup value (0)' as it returns as it is now?
Also I'm having some trouble with some backups not reporting even though I have double checked the task name and server name, but I'm doing some research into if it could have to do with task name containing Swedish letters like ÅÄÖ.
Can this script somehow handle multiple devices that are using the same computer name? Unfortunately many of our customers has a generic AD20xx server name for domain controllers, same goes for RDS20xx. Would it be possible to connect the script to something else than just the name of the server as to work around this?
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 the activity.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 single select
statement.
.mode table
attach database 'activity.db' as actdb;
with cte as (
select dt.login_user, dt.host_name, -- rt.backup_type, rt.task_config,
-- rt.time_start, rt.time_end,
datetime(rt.time_start, 'unixepoch', 'localtime') as time_start,
datetime(rt.time_end, 'unixepoch', 'localtime') as time_end,
(case when rt.time_end is null then ''
else format('%02.1fh', (rt.time_end - rt.time_start) / 3600.0)
end) as hours,
(case when drt.transfered_bytes > 1e12 then (round(drt.transfered_bytes / 1e12, 2) || ' TB')
when drt.transfered_bytes > 1e9 then (round(drt.transfered_bytes / 1e9, 2) || ' GB')
when drt.transfered_bytes > 1e6 then (round(drt.transfered_bytes / 1e6, 2) || ' MB')
when drt.transfered_bytes > 1e3 then (round(drt.transfered_bytes / 1e3, 2) || ' KB')
end) as transferred,
json_extract(rdt.other_params, '$.speed') as speed,
-- rt.result_id,
(case when lt.log_type=1101 then 'started'
when lt.log_type=1102 then 'completed'
when lt.log_type=1115 then 'trigger screenlock'
when lt.log_type=1125 then 'timeout'
when lt.log_type=1137 then 'being processed'
when lt.log_type=1146 then 'missed'
when lt.log_type=1325 then 'deletion succeeded'
when lt.log_type=1327 then 'starting to delete'
else 'unk' end) as result,
dt.device_id, rt.result_id,
rank() over (partition by dt.device_id order by rt.time_end desc) as rn
from device_table dt
left join backup_task_device btd on dt.device_id = btd.device_id
left join task_table tt on tt.task_id = btd.task_id
left join result_table rt on rt.task_id = btd.task_id
and rt.task_config like '%\"device_id\":' || dt.device_id || ',%'
left join device_result_table drt on rt.result_id = drt.result_id
left join result_detail_table rdt on rt.result_id = rdt.result_id
left join log_table lt on rt.result_id = lt.result_id
where (rt.job_action is null or rt.job_action = 1)
and (rdt.log_type is null or rdt.log_type = '1111')
)
select * from cte where rn <= 3
order by device_id, rn
Output (de-PII-ized):
+------------+-----------------+---------------------+---------------------+-------+-------------+-------------+-----------+-----------+-----------+----+
| login_user | host_name | time_start | time_end | hours | transferred | speed | result | device_id | result_id | rn |
+------------+-----------------+---------------------+---------------------+-------+-------------+-------------+-----------+-----------+-----------+----+
| sarah | host1 | | | | | | unk | 3 | | 1 |
| sarah | otherhost | 2024-01-18 08:28:33 | 2024-01-18 08:34:33 | 0.1h | 8.24 GB | 21.00 MB/s | completed | 4 | 1391 | 1 |
| sarah | otherhost | 2024-01-09 07:51:21 | 2024-01-09 07:55:04 | 0.1h | 4.76 GB | 20.00 MB/s | completed | 4 | 1372 | 2 |
| sarah | otherhost | 2023-12-28 15:23:10 | 2023-12-28 15:26:35 | 0.1h | 3.83 GB | 17.00 MB/s | completed | 4 | 1325 | 3 |
| jack | jacks_desktop | 2024-01-21 04:00:02 | 2024-01-21 06:41:36 | 2.7h | 108.96 GB | 10.00 MB/s | completed | 5 | 1404 | 1 |
| jack | jacks_desktop | 2024-01-20 04:00:03 | 2024-01-20 04:06:44 | 0.1h | 4.99 GB | 11.00 MB/s | completed | 5 | 1400 | 2 |
| jack | jacks_desktop | 2024-01-19 04:00:02 | 2024-01-19 04:02:30 | 0.0h | 2.09 GB | 13.00 MB/s | completed | 5 | 1398 | 3 |
| sarah | host2 | 2024-01-13 15:24:34 | 2024-01-13 15:35:42 | 0.2h | 10.09 GB | 14.00 MB/s | completed | 6 | 1382 | 1 |
| sarah | host2 | 2023-12-31 10:53:09 | 2023-12-31 11:06:04 | 0.2h | 14.82 GB | 18.00 MB/s | completed | 6 | 1337 | 2 |
| bob | old_laptop | | | | | | unk | 7 | | 1 |
| bob | current_laptop | 2024-01-22 03:29:42 | 2024-01-22 08:59:56 | 5.5h | 4.0 GB | 197.00 KB/s | completed | 8 | 1406 | 1 |
| bob | current_laptop | 2024-01-20 16:43:22 | 2024-01-20 18:39:34 | 1.9h | 78.86 GB | 10.00 MB/s | completed | 8 | 1401 | 2 |
| bob | current_laptop | 2024-01-10 21:16:17 | 2024-01-13 21:44:27 | 72.5h | 3.3 GB | 12.00 KB/s | timeout | 8 | 1376 | 3 |
| sarah | host3 | | | | | | unk | 9 | | 1 |
+------------+-----------------+---------------------+---------------------+-------+-------------+-------------+-----------+-----------+-----------+----+
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 the lt.log_type
formats I added here; most of that case when
on lt.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 each device_id
, I wanted a simple history/trend.left join
versus inner 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 the attach 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".
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesigner/ -->
<!-- Active URL: https://sql.toad.cz/?keyword=online_library -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" quote=""/>
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
<type label="INT" length="0" sql="INT" quote=""/>
<type label="BIGINT" length="0" sql="BIGINT" quote=""/>
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
<type label="Single precision" length="0" sql="FLOAT" quote=""/>
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
</group>
<group label="Character" color="rgb(255,200,200)">
<type label="Char" length="1" sql="CHAR" quote="'"/>
<type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
<type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
<type label="Binary" length="1" sql="BINARY" quote="'"/>
<type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
<type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
</group>
<group label="Date & Time" color="rgb(200,255,200)">
<type label="Date" length="0" sql="DATE" quote="'"/>
<type label="Time" length="0" sql="TIME" quote="'"/>
<type label="Datetime" length="0" sql="DATETIME" quote="'"/>
<type label="Year" length="0" sql="YEAR" quote=""/>
<type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
</group>
<group label="Miscellaneous" color="rgb(200,200,255)">
<type label="ENUM" length="1" sql="ENUM" quote=""/>
<type label="SET" length="1" sql="SET" quote=""/>
<type label="Bit" length="0" sql="bit" quote=""/>
</group>
</datatypes><table x="1209" y="582" name="info_table">
<row name="id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="info" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="value" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="1150" y="855" name="general_setting_table">
<row name="id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="value" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="213" y="109" name="task_table">
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="storage_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="task_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="backup_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="source_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="custom_volume" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="sched_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="sched_content" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="target_dir" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="dedup_path" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="unikey" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="retention_policy" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="enable_dedup" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="enable_notify" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="cbt_enable_mode" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="bandwidth" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="connection_timeout" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="max_concurrent_devices" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="enable_verification" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="verification_policy" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="enable_app_aware_bkp" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="enable_encrypt_transfer" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="enable_compress_transfer" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="agentless_backup_policy" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="agentless_enable_dedup" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="agentless_enable_windows_vss" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="agentless_enable_block_transfer" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="agentless_backup_path" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="enable_datastore_aware" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="datastore_reserved_percentage" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="backup_external" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="pre_post_script_setting" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="backup_cache_content" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="bandwidth_content" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="enable_shutdown_after_complete" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="enable_windows_working_state" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="enable_wake_up" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="sched_modify_time" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="dedup_api_restore" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="view_type" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="18" y="13" name="device_table">
<row name="device_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="device_uuid" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="create_time" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="backup_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="host_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="host_ip" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="host_port" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="os_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="login_user" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="login_user_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="login_password" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="login_time" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="agent_token" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="inventory_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="vm_moid_path" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="agentless_auth_policy" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="hypervisor_id" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="dsm_unique" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="dsm_model" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="auto_discovery" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
</table>
<table x="1288" y="918" name="storage_table">
<row name="storage_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="volume_path" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="share_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="repo_dir" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="fs_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="automount_location" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="automount_iv" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="1226" y="889" name="inventory_table">
<row name="inventory_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="inventory_uuid" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="host_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="host_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="host_addr" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="port_webapi" null="0" autoincrement="0">
<datatype>INT</datatype>
</row>
<row name="auth_user" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="auth_password" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="auth_thumbprint" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="nfc_host_port" null="0" autoincrement="0">
<datatype>INT</datatype>
</row>
<row name="status" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="nfc_nas_addr" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="nfc_nas_port" null="0" autoincrement="0">
<datatype>INT</datatype>
</row>
<row name="protocol" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="other_spec" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="1300" y="655" name="available_task_device">
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="task_table" row="task_id" />
</row>
<row name="device_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="device_table" row="device_id" />
</row>
</table>
<table x="205" y="21" name="backup_task_device">
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="task_table" row="task_id" />
</row>
<row name="device_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="device_table" row="device_id" />
</row>
<key type="PRIMARY" name="">
</key>
</table>
<table x="1348" y="703" name="backup_task_user">
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="task_table" row="task_id" />
</row>
<row name="dsm_uid" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
</table>
<table x="1231" y="622" name="backup_task_group">
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="dsm_gid" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
</table>
<table x="1317" y="329" name="vm_task_script_table">
<row name="id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="task_table" row="task_id" />
</row>
<row name="device_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="device_table" row="device_id" />
</row>
<row name="vm_moid_path" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="enabled" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="script_exec_mode" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="script_os_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="pre_script_path" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="post_script_path" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="1418" y="737" name="agent_version_table">
<row name="device_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="device_table" row="device_id" />
</row>
<row name="major" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="minor" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="mini" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="build" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="1456" y="775" name="agent_token_dirty_device">
<row name="device_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="device_table" row="device_id" />
</row>
</table>
<table x="1064" y="820" name="delegation_role_table">
<row name="dummy_key" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="id" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="id_type" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="auth_type" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="role_backup" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="role_restore" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="role_delete" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="role_admin" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
</table>
<table x="1275" y="281" name="vm_task_folder_table">
<row name="dummy_key" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="task_table" row="task_id" />
</row>
<row name="inventory_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="folder_id" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="folder_type" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="exclusive_folder_id" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="exclusive_vm_id" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="view_type" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="786" y="1201" name="info_table">
<row name="id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="info" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="value" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
<table x="837" y="681" name="log_table">
<row name="log_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="log_level" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="log_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="log_time" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="error_code" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="user_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="user_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="task_table" row="task_id" />
</row>
<row name="task_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="backup_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="device_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="device_table" row="device_id" />
</row>
<row name="device_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="other_params" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="result_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="result_table" row="result_id" />
</row>
</table>
<table x="469" y="328" name="result_table">
<row name="result_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="status" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="task_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="task_table" row="task_id" />
</row>
<row name="task_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="backup_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="time_start" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="time_end" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="detail_path" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="task_config" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="success_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="warning_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="error_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="none_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="job_action" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
</table>
<table x="640" y="561" name="device_result_table">
<row name="device_result_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="result_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="result_table" row="result_id" />
</row>
<row name="config_device_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="status" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="device_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="time_start" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="time_end" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="transfered_bytes" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="processed_bytes" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
</table>
<table x="656" y="350" name="result_detail_table">
<row name="result_detail_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="log_level" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="log_type" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="log_time" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="other_params" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="error_code" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="result_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="result_table" row="result_id" />
</row>
</table>
<table x="687" y="1168" name="storage_log_table">
<row name="storage_log_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="volume_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="share_name" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="log_time" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="usage_size" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="volume_free_space" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
</table>
<table x="667" y="1114" name="report_table">
<row name="report_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="report_time" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="report_interval" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="uri_suffix" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
</table>
</sql>
Offered solely as a "hope it helps".
Thanks WAdama, the code works perfect. Would this code also be suitable to look at the Synology Hyper Backup status?
thanks,
Gareth
Hi WAdama,
I have managed to get the script up and running minus 1 part of it.
When I add my device as a parameter, this does not show up as a device in the Probe (it shows as unknown as I had to add an option for 0 as that gave errors also)
Adding the VM name in the sensor
VM name not showing so pulls no info
Device name as showing in ABB
I'm pretty sure there is just something simple I am missing but I cannot see it and was wondering if you would be able to shed any light on it.
Thanks
Hello,
Your code require jq package. How can you install it on a new Synology device ?
Thanks,
Matthieu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.