How to check Linux HDD S.M.A.R.T. with PRTG sensor

How to check Linux HDD S.M.A.R.T. with PRTG sensor

CentOS HDD S.M.A.R.T. shell script.

 Create path 

/var/prtg/scripts

 Install smartmontools

yum install smartmontools

 Start the service

service smartd start
chkconfig smartd on

 Create shell script

touch hddsmart.sh

 And paste the following

#!/bin/bash
serviceIsRunning=false
var1=$(smartctl -H /dev/sda |grep result |sed 's/..............................$
var2=$(echo $data)
if [ "$var1" == PASSED ]
then
serviceIsRunning=true
echo "0:200:PASSED"
fi
if [ $serviceIsRunning == false ]
then
echo "2:404:FAILED"
fi

 Save and Exit

 Make it executable

chmod +x hddsmart.sh

Go to PRTG : 

Add Sensor- SSH Script
Choose script - hddsmart.sh

Save

 

! Make sure your PRTG Server has access to Asterisk Server, if not, add root username and password
to the credentials in the BASIC DEVICE SETTINGS

Screenshot from 2016-05-31 18-10-05

How to install Arch Linux

How to install Arch Linux

Arch Linux installation.

 Disk layout

cfdisk /dev/sda

 Create file system ext4

mkfs.ext4 /dev/sda1

 Create swap file system

mkswap /dev/sda2

 Enable swap file system

swapon /dev/sda2

Mount the primary partition

mount /dev/sda1 /mnt

 Create home directory

mkdir /mnt/home && mount /dev/sda1 /mnt/home

 Installation

pacstrap /mnt base base-devel
pacstrap /mnt grub-bios
genfstab –p /mnt >> /mnt/etc/fstab
arch-chroot /mnt

Configuration

vi /etc/hostname
vi /etc/hosts
vi /etc/vconsole.conf – #KEYMAP=ru FONT=cyr-sun16 FONT_MAP=
nano /etc/timezone – #Europe/Moscow
ln –s /usr/share/zoneinfo/Europe/Moscow /etc/localtime
hwclock –-systohc –-utc
nano /etc/locale.gen – #ru_RU.UTF-8 UTF-8 en_US.UTF-8 UTF-8
nano /etc/locale.conf – #LANG=”ru_RU.UTF-8”
locale-gen

 Grub installation

mkinitcpio –p linux
grub-install /dev/sda #--force
grub-mkconfig –o /boot/grub/grub.cfg
systemctl enable dhcpcd

Exit

umount /mnt
reboot

Add user

useradd –g users –G wheel,audio,video,storage –m testuser1
usermod -G wheel testuser1
passwd testuser1
cd /etc/
nano sudoers #after root ALL=(ALL) ALL add
testuser1 ALL=(ALL) ALL

 

 Desktop environment installation

XFCE

pacman –Suy xorg xorg-xinit xorg-utils
pacman –S xfce4 lxdm
systemctl enable lxdm

 KDE

pacman –S kde gamin
pacman –S kde-110n-ru
touch ~/.xinitrc
nano~/.xinitrc #add exec ck-launch-session startkde
systemctl enable kdm service
systemctl start kdm service

 GNOME

pacman –S gnome
systemctl enable gdm.service

Sound

pacman –S alsa-utils alsa-oss

 Prerequisites for installing the video card driver

pacman –S binutils make make gss Linux-headers

Keyboard Layout

setxkbmap –layout “us,ru” –option “grp:alt_shift_toggle”