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
A script was created to check replication status on truenas
I made the script executable
I moved the key so zabbix can access it
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
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

Any help would be greatly appreciated.
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
ssh- copy- id - i ~/.ssh/truenas_key.pub
USER@TRUENAS_IP
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" '
#!/bin/bash
ssh - i /home/zabbix/.ssh/truenas_key - o StrictHostKeyChecking=no
USER@TRUENAS_IP \
' midclt call replication.list | jq " [.[] | select(.status != " FINISHED" )] | length" '
sudo chmod +x /usr/lib/zabbix/externalscripts/check_replication_status.sh
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
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
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
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
However, it does not give this output when checking Monitoring --> Latest Data
Any help would be greatly appreciated.
Comment