Sometimes we may want to preserve the environment variables of the original user when using sudo.
If you want to preserve all env variables, you could use the -E option. But use it with caution.
sudo -E bash -c 'echo $PATH'
A better approach is to list those env variables which u want to preserve in the sudoers config file. For example, i want to keep the HTTP_PROXY and HTTPS_PROXY.
collectd is a statistics gathering tools which helps system admin to analysis the system conditions. It includes both server and client implementations. The collectd client send metrics to the collectd server.
I installed the collectd on a CentOS 7 machine and try to send the metrics to a Graphite instance. But no matter how i changed the setup, the Graphite couldn’t receive any data. Finally, i realized that it is blocked by the SELinux policy. Continue reading collectd – Cannot send out matrics→
Monit is a opensource monitoring tool on Unix system. The simplest use case would be restarting your service if there is failure.
On Ubuntu, simply run apt-get to install Monit.
sudo apt-get install monit
The Monit folder is at /etc/monit. Before you can read anything from Monit, create the /etc/monit/conf.d/monit.conf in order to setup the Monit web interface.
set httpd port 2812 and
use address localhost
allow localhost
One day i found that the Puppet master is running out of space and then i realize that there is a lot of run reports in YAML format located @ /var/lib/puppet/reports. I want to delete the old reports for releasing the disk space.
So i move to the /var/lib/puppet/reports directory and execute the following line to recursively remove any .yaml which is older than 14 days.
When a new rpm is added to a yum repository server, the cache in the client machine makes the new rpm unreachable. To check for update of repositories, run the following command in the client.