【nfs-ganesha】dbus-send
dbus-send命令
1. 列出所有的clients:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ClientMgr org.ganesha.nfsd.clientmgr.ShowClients
列出某个导出点的信息:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.DisplayExport uint16:100
列出export:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.ShowExports
列出某个导出点的信息:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.DisplayExport uint16:100
ShowExports:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.ShowExports
查询某个client的NFS3统计:(127.0.0.1为ip地址,根据ip地址进行查询,以下同)
dbus-send --system --print-reply --dest=org.ganesha.nfsd /org/ganesha/nfsd/ClientMgr org.ganesha.nfsd.clientstats.GetNFSv3IO string:"127.0.0.1"
设置ganesha的log输出等级:(NIV_DEBUG、NIV_FULL_DEBUG为日志等级)
dbus-send --system --print-reply --dest=org.ganesha.nfsd /org/ganesha/nfsd/admin org.freedesktop.DBus.Properties.Set string:org.ganesha.nfsd.log.component string:COMPONENT_FSAL variant:string:NIV_DEBUG
dbus-send --system --print-reply --dest=org.ganesha.nfsd /org/ganesha/nfsd/admin org.freedesktop.DBus.Properties.Set \
string:org.ganesha.nfsd.log.component string:COMPONENT_FSAL variant:string:NIV_FULL_DEBUG
查询有关的NFS状态情况
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportstats.StatusStats
查看ganesha 缓存文件数目
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportstats.ShowCacheInode
To remove export:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport uint16:export_id
# ex:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport uint16:3
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/path-to-new-export-file string:"EXPORT(Path=/volname)"
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/path-to-new-export-file string:"EXPORT(export_id=uint16)"
# ex:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:/etc/ganesha/test.conf string:"export(path=/opt/testnfs)"
method return time=1552554389.002397 sender=:1.263 -> destination=:1.282 serial=593 reply_serial=2
string "1 exports updated"
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:/etc/ganesha/test.conf string:"export(export_id=3)"
method return time=1552554430.929315 sender=:1.263 -> destination=:1.283 serial=636 reply_serial=2