salt -N 'ceph' test.ping # Test connectivitysalt -E '^server10*' test.ping # Match by regex for connectivitysalt -S 192.168.150.101 test.ping # Match by agent IP addresssalt -S 192.168.150.0/24 test.ping # Match by IP subnetsalt -N 'ceph' cmd.run 'df -Th'# Check disk usage by groupsalt -N 'ceph' cmd.exec_code python 'import os; print os.system("df -Th")'# Execute Python codesalt -N 'ceph' cmd.exec_code perl 'print scalar localtime'# Execute Perl codesalt -G 'osrelease:6.3' cmd.run 'python -V'# Filter by grains and executesalt '*' smbios.get system-serial-number # Get server hardware serial number
salt -N 'ceph' disk.percent /data01 # Get disk usage percentagesalt -N 'ceph' disk.nodeusage /data01 # Get inode usagesalt -N 'ceph' xfs.info /data01 # Get XFS partition info
salt -N 'ceph' user.list_users # List all system userssalt -N 'ceph' user.info lianghaiqiang # Show user detailssalt -N 'ceph' user.delete lianghaiqiang remove=True force=True # Force delete user
salt -N 'ceph' timezone.get_zone # Get timezonesalt -N 'ceph' timezone.set_zone # Set timezonesalt -N 'ceph' system.reboot # Reboot systemsalt -N 'ceph' cron.list_tab root # List root's cron jobssalt -N 'ceph' cron.raw_cron root # List root's cron jobs in raw text format
salt -N 'ceph' sys.doc sys # Get system helpsalt 'gpu054' sys.list_functions grains # List available grains functionssalt 'gpu054' sys.doc grains # View grains documentationsalt 'gpu054' sys.doc disk # View disk module documentationsalt 'gpu054' sys.list_functions pillar # List pillar functionssalt 'gpu054' sys.doc pillar # View pillar documentationsalt 'gpu054' pillar.item # List supported pillar data sourcessalt 'gpu054' sys.list_modules # List available minion modulessalt 'gpu054' sys.list_functions pip # List pip module functionssalt 'gpu054' sys.doc pip # View pip module helpsalt 'gpu054' sys.list_state_modules # List all state modulessalt 'gpu054' sys.list_state_functions pkg # List pkg state functionssalt 'gpu054' sys.state_doc pkg # View pkg state help
salt-run jobs.active # View active jobs on all minions (running saltutil.running)salt-run jobs.lookup_jid <jid> # Query results for a specific JID from master job cachesalt-run jobs.list_jobs # List all current jobs in master job cachesalt 'xxxx' saltutil.kill_job <jid> # Kill a job on the master