Rex::Commands::Sysctl - Manipulate sysctl
With this module you can set and get sysctl parameters.
use Rex::Commands::Sysctl; my $data = sysctl "net.ipv4.tcp_keepalive_time"; sysctl "net.ipv4.tcp_keepalive_time" => 1800;
This function will read the sysctl key $key.
If $val is given, then this function will set the sysctl key $key.
task "tune", "server01", sub { if( sysctl("net.ipv4.ip_forward") == 0 ) { sysctl "net.ipv4.ip_forward" => 1; } };
To install Rex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rex
CPAN shell
perl -MCPAN -e shell install Rex
For more information on module installation, please visit the detailed CPAN module installation guide.