Ad Widget

Collapse

Monitoring Snapshot and Replication Tasks in TrueNAS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DoItAgainSteelyDan
    Junior Member
    • Mar 2025
    • 21

    #1

    Monitoring Snapshot and Replication Tasks in TrueNAS

    Hello, looking for someone familiar with monitoring replication tasks in TrueNAS.

    I enabled SNMP/SSH.

    I set up SSH key authentication from zabbix to truenas
    ssh- keygen - t rsa - f ~/.ssh/truenas_key - N " "
    ssh- copy- id - i ~/.ssh/truenas_key.pub
    USER@TRUENAS_IP
    A script was created to check replication status on truenas

    sudo nano /usr/lib/zabbix/externalscripts/check_replication_status.sh
    #!/bin/bash
    ssh - i /home/zabbix/.ssh/truenas_key - o StrictHostKeyChecking=no
    USER@TRUENAS_IP \
    ' midclt call replication.list | jq " [.[] | select(.status != " FINISHED" )] | length" '
    I made the script executable
    sudo chmod +x /usr/lib/zabbix/externalscripts/check_replication_status.sh
    I moved the key so zabbix can access it
    sudo mkdir - p /home/zab/.ssh
    sudo cp /home/zbtest/.ssh/truenas_key /home/zab/.ssh/
    sudo chown zabbix:zabbix /home/zab/.ssh/truenas_key
    sudo chmod 600 /home/zab/.ssh/truenas_key​
    Edited the sudoers file manually from truenas shell so that sudo is working for root.

    I then create a snapshot and replicaiton task in TrueNAS

    I test the replication by querying it with midclt call replication.query in TrueNAS shell which works perfectly.

    I created a zabbix item as SSH agent with public and private key. Zabbix tells me this is not supported.


    I also made sure the ownership and permissions were correct
    sudo chown - R zabbix:zabbix /etc/zab/ssh_keys
    sudo chmod 700 /etc/zab/ssh_keys
    sudo chmod 600 /etc/zab/ssh_keys/truenas_id_rsa
    sudo chmod 644 /etc/zab/ssh_keys/truenas_id_rsa.pub
    I am able to SSH into the truenas server via Zabbix terminal, and run the command for an output of 0 or 1 (1 meaning success, 0 meaning fail)

    However, it does not give this output when checking Monitoring --> Latest Data
    Click image for larger version  Name:	image.png Views:	1 Size:	5.0 KB ID:	501771

    Any help would be greatly appreciated.​​
    Last edited by DoItAgainSteelyDan; 11-04-2025, 21:55.
  • Moob
    Member
    • Mar 2025
    • 31

    #2
    Hi,

    You did set the SSHKeyLocation parameter in the server config ?

    Regards

    Comment

    Working...