Module for interfacing with SysFS
New in version 2016.3.0.
Access/write a SysFS attribute. If the attribute is a symlink, its destination is returned
value or bool
CLI Example:
salt '*' sysfs.attr block/sda/queue/logical_block_size
Generate a dictionary with all available interfaces relative to root. Symlinks are not followed.
CLI Example:
salt '*' sysfs.interfaces block/bcache0/bcache
{
"r": [
"state",
"partial_stripes_expensive",
"writeback_rate_debug",
"stripe_size",
"dirty_data",
"stats_total/cache_hits",
"stats_total/cache_bypass_misses",
"stats_total/bypassed",
"stats_total/cache_readaheads",
"stats_total/cache_hit_ratio",
"stats_total/cache_miss_collisions",
"stats_total/cache_misses",
"stats_total/cache_bypass_hits",
],
"rw": [
"writeback_rate",
"writeback_rate_update_seconds",
"cache_mode",
"writeback_delay",
"label",
"writeback_running",
"writeback_metadata",
"running",
"writeback_rate_p_term_inverse",
"sequential_cutoff",
"writeback_percent",
"writeback_rate_d_term",
"readahead"
],
"w": [
"stop",
"clear_stats",
"attach",
"detach"
]
}
Note
'r' interfaces are read-only
'w' interfaces are write-only (e.g. actions)
'rw' are interfaces that can both be read or written
Read from SysFS
key -- file or path in SysFS; if key is a list then root will be prefixed on each key
the full (tree of) SysFS attributes under key
CLI Example:
salt '*' sysfs.read class/net/em1/statistics
Return the basename of a SysFS key path
key -- the location to resolve within SysFS
full -- full path instead of basename
fullpath or basename of path
CLI Example:
salt '*' sysfs.read class/ttyS0
Write a SysFS attribute/action
CLI Example:
salt '*' sysfs.write devices/system/cpu/cpu0/cpufreq/scaling_governor 'performance'