Return host memory usage information
Func ' * ' Call command Run "df-m"
Func ' * ' Call command Run "Df-h"
Func ' * ' Call command Run "free-m"
Return host uptime Information
Func ' * ' Call command Run "uptime"
Get remote host CPU information
Func ' * ' Call CPU Usage
Func ' * ' Call CPU usage 10
Get remote host disk partition information
Func ' * ' Call disk usage
Func ' * ' Call disk Usage/data
Get remote host system hardware information
Func ' * ' Call hardware info
Func ' * ' Call hardware Hal_info
Implementing remote host Process Management
Func ' * ' Call process info ' aux '
Func ' * ' Call process Pkill nginx-9
Func ' * ' Call process kill Nginx SIGHUP
Implementing remote host system service Management
Func ' * ' Call service start Nginx
Implement kernel parameter management of remote host system
Func ' * ' Call sysctl list
Func ' * ' Call sysctl get Net.nf_conntrack_max
Func ' * ' Call Sysctl set Net.nf_conntrack_max 15449
View all host uptime, turn on 5 threads to run asynchronously, the timeout time is 3 seconds, the command is as follows:
FUNC-T 3 "*" Call--forks= "5"--async command Run "/usr/bin/uptime"
Format the output, the default format for the Python tuple, add--jsion or--xml to output JSON and XML format, the command is as follows:
FUNC-T 3 "*" Call--forks= "5"--json--async command Run "/usr/bin/uptime"
Example: All the target hosts that meet the kernel version greater than or equal to 2.6, and the operating system information contains CentOS, run the uptime command
Func "*" Call--filter "Kernel>=2.6,centos in OS" command Run "uptime"
Example: All target hosts that meet the kernel version greater than or equal to 2.6, or run level equals 5 run the df-m command
Func "*" Call--filteror "kernel>=2.6,runlevel=5 in OS" command Run "df-m"
This article is from the "My Ops Road" blog, so be sure to keep this source http://pythonhome.blog.51cto.com/10015972/1622618
Func Common Operations Commands