Skip to content

Instantly share code, notes, and snippets.

@Zobber
Last active September 30, 2022 21:37
Show Gist options
  • Save Zobber/ffbe5346afcf389f3cf92fb253708908 to your computer and use it in GitHub Desktop.
Save Zobber/ffbe5346afcf389f3cf92fb253708908 to your computer and use it in GitHub Desktop.
## Check information about the AD
net ads info join status workgroup gpo dns user
## Commands for to verify the conection established with AD
1) sqlite3 /data/freenas-v1.db "UPDATE directoryservice_activedirectory SET ad_enable=1"
2) service ix-hostname start
3) service ix-kerberos start
4) service ix-kinit start
5) service ix-pre-samba start
6) net -k -d 7 ads join
## Sync ntp server
service ntpd stop
ntpdate <name or ip of the server>
service ntpd start
## test the connection
wbinfo -t
## Show user and groupd from AD
wbinfo -g
wbinfo -u
## Test AD Connection
midclt call activedirectory.get_state
midclt call activedirectory.domain_info | jq
## Scrub Task
zpool status
zpool scrub -s <Poolname> from the command line will stop
## Set boot environment via console
beadm list
beadm activate <release>
## Analyze and check bad sectors in hdd
http://bytesandbolts.com/fixing-freenas-error-currently-unreadable-pending-sectors/
https://dekoder.wordpress.com/2014/10/08/fixing-freenas-currently-unreadable-pending-sectors-error/
https://www.ixsystems.com/community/threads/is-this-a-bad-sign-smartd-1-currently-unreadable-pending-sectors.9824/
@crpb
Copy link

crpb commented Sep 30, 2022

Hey there,

nice list.

Maybe you like those too 🙈

#Diskinfos
midclt call disk.query |jq -r '.[]| .name,.serial,.model' | paste -d " " - - - | while read device model serial ;do temp=$(midclt call disk.temperature $device); years=$(h=$(smartctl -A /dev/$device |grep -E -i 'power_on|power on'|awk '{print $NF;}'); echo "scale=3; ${h%%\:*}/24/365" |bc -l); firmware=$(smartctl -i /dev/$device |awk '/Firmware Version|Revision/ {print $NF}'); echo "$device;$temp;$model;$serial;$firmware;$years"; done
#domain-infos
midclt call idmap.query |jq --arg DOMAIN "$(hostname -d|tr 'a-z' 'A-Z')" '.[]|select(.dns_domain_name == $DOMAIN)'
#set warnings as read
midclt call alert.list |jq -r '.[].uuid' |while read id; do midclt call alert.dismiss $id; done

@Zobber
Copy link
Author

Zobber commented Sep 30, 2022

Hey @crpb , thanks u for the reply and add the info, regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment