Oracle Solaris Master Command Reference
1. ILOM (Integrated Lights Out Manager)
> version → Show ILOM version
> show /System model part_number serial_number → Show system model, part number, serial number
> show /System sys_fw_version → Show system firmware version
> show /SP/VPS value → Show system power consumption
> show /System health → Show system health status
> power on → Power on the host
> power off → Power off the host
> power cycle → Reboot the host
> console → Access host console
> show /SP/host → Show host status
> set /SP/network pendingipaddress=<ip> pendingipdiscovery=static pendingipgateway=<gw> pendingipnetmask=<mask> commitpending=true → Set ILOM IP
> set /SP/clients/dns auto_dns=disabled nameserver=<dns1>,<dns2> → Set DNS servers
> set /SP/clients/ntp/server/1 address=<ntp_server> → Set NTP server
> set /SP/clock usentpserver=enabled → Enable NTP
> show -level all -output table /System → Show system inventory
> show -level all -output table /System type==Temperature → Show temperature sensors
> show -level all -output table /System type=='Power Supply' → Show power supplies
> show -level all -output table /System type=='Hard Disk' → Show disks
> show /SP/logs/event/list → Show event log
> load -source tftp://<server>/<firmware_file> → Update ILOM firmware
> reset /SP → Reset ILOM service processor
> set /SP reset_to_defaults=all → Factory reset ILOM
> dump -destination tftp://<server>/<backup_file> → Backup ILOM config
> load -source tftp://<server>/<backup_file> → Restore ILOM config
> set /SP/alertmgmt/rules/1 type=snmptrap snmp_version=1 destination=<ip> destination_port=162 community_or_username=<community> level=critical → Configure SNMP alert
> set /SP/alertmgmt/rules/1 type=email destination=<email> level=critical → Configure email alert
> create /SP/users/<username> password=<pwd> role=administrator → Add user
> delete /SP/users/<username> → Delete user
> show /SP/users → Show users
> set /SP/services/ssh servicestate=enabled → Enable SSH
> set /SP/services/https servicestate=enabled → Enable HTTPS
> help <command> → Help for command
> help targets → List all targets
> cd <target> → Change target
> exit → Exit CLI
2. LDOM (Oracle VM Server for SPARC)
# pkginfo | grep ldom → Check LDOM package installed
# ldm list → Show existing LDOMs
# ldm add-domain <guest> <options> → Create guest domain
# ldm add-vcpu <num> <guest> → Add virtual CPU
# ldm set-memory <guest> <size>M → Assign memory
# ldm add-vnet <vnet> <guest> primary-vsw=<vsw> → Add virtual network
# ldm list-devices → List available disks
# ldm add-vds <vds> <guest> primary-vds=<disk> → Add virtual disk
# ldm start-domain <guest> → Start guest
# ldm set-vcpu <guest> <num> → Set vCPU
# ldm set-memory <guest> <size>M → Set memory
# ldm add-profile <guest> → Make configuration persistent
# ldm console <guest> → Access guest console
# ldm list -o → List domains & vdisks
# ldm show-vds <vds> → Show vds details
# ldm migrate-vds <vds> primary-vds=<new_disk> → Live migrate vds
# ldm stop-domain <guest> → Stop domain
# ldm set-vds <vds> primary-vds=<new_disk> → Change vds disk
# ldm remove-vds <vds> <guest> → Remove old vds
# ldm list-vnet <guest> → Show vnets
# ldm remove-vnet <vnet> <guest> → Remove vnet
# ldm add-vnet <vnet> <guest> primary-vsw=<vsw> → Add vnet
LDOM Profile Example
# ldm load-profile -c webserver1.cfg → Validate profile
# ldm load-profile webserver1.cfg → Load profile
# ldm add-profile webserver1.cfg → Make persistent
# ldm list → Verify LDOM
# ldm console webserver1 → Access console
3. Solaris Cluster
# cluster create -n <cluster_name> → Create cluster
# cluster addnode -n <node> → Add node
# cluster list → Show nodes
# clresourcegroup create -n <name> → Create resource group
# clresource create <type> -n <name> -p <params> → Add resource
# clresource enable -n <name> → Enable resource
# clresource disable -n <name> → Disable resource
# clresource list → Show resource status
# cluster stop -n <node> → Simulate node failure
4. User & Authentication Management
# useradd -m -d /home/john -s /bin/bash -c "John Doe, IT" john → Create user
# passwd john → Set password
# usermod -c "New Info" john → Change GECOS info
# usermod -s /bin/ksh john → Change shell
# usermod -d /home/john_new -m john → Move home directory
# usermod -u 1500 -g staff john → Change UID/GID
# usermod -G wheel,adm john → Add supplementary groups
# usermod -L john → Lock account
# usermod -U john → Unlock account
# passwd -f john → Force password change
# userdel john → Delete user
# userdel -r john → Delete user + home
# passwd -x 90 john → Max password age
# passwd -n 7 john → Min days between change
# passwd -w 7 john → Warning days
# usermod -e YYYY-MM-DD john → Set account expiry
# id john → Show UID/GID & groups
# finger john → Show user info
# getent user_attr john → Show Solaris attributes
5. File & Folder Management
# ls -l filename → Show ownership & permissions
# ls -ld /path/to/dir → Show directory details
# ls -V filename → Show ACLs
# chown john file.txt → Change owner
# chgrp staff file.txt → Change group
# chown john:staff file.txt → Change owner & group
# chmod u+rwx,g=rx,o=r file.txt → Set symbolic permissions
# chmod 754 file.txt → Numeric permissions
# chmod g+w file.txt → Add permission
# chmod o-r file.txt → Remove permission
# chmod -R 755 /dir → Recursive change
# chmod u+s filename → Setuid
# chmod g+s directory → Setgid
# chmod +t directory → Sticky bit
# chmod A+user:john:read_data file.txt → Add ACL
6. Package Management & Boot Environment
# cat /etc/release → Solaris version
# pkg list -i → List installed packages
# pkg list -u → Check updates
# pkg install <package> → Install package
# pkg update --accept → Update all packages
# pkg update <pkg_name> → Update specific package
# beadm list → List boot environments
# beadm create <BE_name> → Create BE
# beadm activate <BE_name> → Activate BE
# beadm destroy <BE_name> → Destroy BE
# beadm mount <BE_name> → Mount BE
# beadm umount <BE_name> → Unmount BE
# zoneadm -z <zone> halt → Halt non-global zone
# zoneadm -z <zone> boot → Boot non-global zone
7. ZFS & SVM Management
# zpool list → List zpools
# zpool status → Health & errors
# zpool create <pool> <disk> → Create pool
# zpool destroy <pool> → Destroy pool
# zpool add <pool> <disk> → Add disk to pool
# zpool scrub <pool> → Data scrub
# zfs list → Show ZFS filesystems
# zfs create <pool/fs> → Create filesystem
# zfs snapshot <pool/fs@snap> → Create snapshot
# zfs rollback <pool/fs@snap> → Rollback snapshot
# zfs send <pool/fs@snap> | zfs receive <pool2/fs> → Replicate snapshot
# metadb → Manage SVM state DB
# metainit → Initialize metadevices
# metattach <mirror> <disk> → Attach disk
# metadetach <mirror> <disk> → Detach disk
# metastat → Status of metadevices
# metaclear <disk> → Clear metadevice config
8. Networking
# ifconfig -a → List interfaces
# ipadm create-ip <if> → Create IP
# ipadm create-addr -T static -a <ip>/<mask> <if>/v4 → Assign IP
# route add <network> <gateway> → Add route
# route delete <network> → Delete route
# netstat -rn → Show routing table
# dladm show-phys → Show physical NICs
# dladm show-link → Show link status
# dladm set-linkprop <link> mtu=9000 → Set MTU
# snoop -d <interface> → Capture traffic
# tcpdump -i <interface> → Capture packets
# nslookup <host>, dig <host> → Check DNS
9. Jobs Scheduling & Monitoring
# crontab -l → List user cron jobs
# crontab -e → Edit cron
# crontab -r → Remove cron
# atq → List at jobs
# atrm <job_number> → Remove at job
# echo "/path/to/command" → Schedule one-time job
10. Performance & Troubleshooting
# prstat, mpstat, vmstat, sar -u → CPU usage
# iostat -x, zpool iostat -v → Disk I/O
# netstat -i, netstat -s, dladm show-link → Network
# prstat -a → CPU per user
# uptime → System load
# tail -f /var/adm/messages → Real-time logs
# dmesg → Kernel logs
# fmadm faulty → Hardware faults
# fmadm repair <resource> → Repair faulty
# fmadm config → FM configuration
11. System & Boot Commands
# uname -a → Kernel & arch
# showrev -p → Patch info
# prtdiag → Hardware diagnostic
# reboot → Reboot system
# shutdown -i6 -g0 -y → Immediate reboot
# df -h → Disk usage
# du -sh /path → Folder size
# mount → Show mounted
12. Filesystems
# umount /path → Unmount
# swap -l → Show swap devices
# swap -s → Show swap usage
# hostname → Show/set hostname
No comments:
Post a Comment