Tag Archives: server

puppet: step-by-step

Server:

apt-get install puppet puppetmaster
insert into /etc/puppet/manifests/site.pp

1
2
3
4
5
6
7
8
9
10
11
12
class common {
  file { "/tmp/testfile":
    owner => root,
    group => admin,
    mode => 664,
    ensure => present
  }
}

node default {
  include common
}

/etc/init.d/puppetmaster restart

Client:

apt-get install puppet

1
openssl s_client -connect 127.0.0.1:8140 |grep subject
1
2
...
subject=/CN=puppet-master.local

add to /etc/puppet/puppet.conf

1
server=puppet-master.local
1
puppetd --verbose --test

Server:

1
puppetca --sign --all

 

Client:

1
puppetd --verbose --test


/etc/init.d/puppet start

nagios hdd smart

Client side

aptitude install nagios-nrpe-server nagios-plugins-basic smartmontools

# netstat -an | grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN

edit /etc/nagios/nrpe.cfg

allowed_hosts=127.0.0.1,195.43.68.2

dont_blame_nrpe=1

command[check_smart]=/usr/lib/nagios/plugins/check_smart -t -d $ARG1$

/etc/init.d/nagios-nrpe-server restart

wget -P /usr/lib/nagios/plugins/ http://dl.dropbox.com/u/5742349/check_smart

chmod +x /usr/lib/nagios/plugins/check_smart

echo «nagios ALL=(ALL) NOPASSWD:/usr/sbin/smartctl» >> /etc/sudoers

 

Server side

edit /etc/nagios3/conf.d/group.cfg

define hostgroup{
hostgroup_name          check_lnx_smart0
alias Linux S.M.A.R.T TEST Disk 0
members server1,server2,server3
}
define hostgroup{
hostgroup_name          check_lnx_smart1
alias Linux S.M.A.R.T TEST Disk 1
members server1,server3
}

 

edit /etc/nagios3/conf.d/services.cfg

define service{
use                     generic-service
hostgroup_name          check_lnx_smart0
service_description     Linux SMART Disk sda
check_command           check_nrpe_smart!/dev/sda
check_interval          720
}

define service{
use                     generic-service
hostgroup_name          check_lnx_smart1
service_description     Linux SMART Disk sdb
check_command           check_nrpe_smart!/dev/sdb
check_interval          720
}

/etc/init.d/nagios3 reload

vsftpd. FTP for a couple of minutes

 

Merge vsftpd, from here you can ftp://vsftpd.beasts.org/users/cevans/.
sudo -i
mkdir ~/temp | | cd ~/temp
wget ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.3.0pre1.tar.gz
Unpack:
tar xvfz vsftpd-2.3.0pre1.tar.gz
Collect:
make
Appears vsftpd binary, copy it to a folder with the binaries:
cp vsftpd/usr/sbin/
Check whether there is user nobody:
cat /etc/passwd | grep nobody
If not — add:
useradd nobody
For default configuration, you must create a /usr/share/empty/:
mkdir /usr/share/empty/
Next, you need to create ftp user to home directory in /var/ftp/, then it will be the root of our server.
mkdir /var/ftp/
useradd-d /var/ftp ftp
Change the owner of the folders on the root and the appropriate rights:
chown root.root /var/ftp
chmod og-w /var/ftp
Transfer the actual file configuration in /etc:
cp vsftpd.conf /etc
Next edit vsftpd.conf:
vim /etc/vsftpd.conf

Continue reading vsftpd. FTP for a couple of minutes