Category Archives: Hosting

Zabbix monitor DISK I/O

Zabbix disk i/o template:
zbx_linux_disk_io_template.xml.tar

Auto discovery script for zabbix agents written in perl:

#!/usr/bin/perl
use strict;
use warnings;

# Options
my $_proc = “/proc/diskstats”;

# Validate options
if ( ! -e $_proc)
{
die “File $_proc not found!”;
}

# Keep count
my $_first = 1;

# Present the data in JSON format
print “{\n”;
print “\t\”data\”:[\n\n”;

# Fetch the data and put it in an array
my @_data = `cat $_proc | awk ‘{ print \$3 }’`;
chomp @_data;

# Read the array and print the wanted data
foreach my $_disk (@_data)
{
# Print the data in JSON
print “\t,\n” if not $_first;
$_first = 0;

print “\t{\n”;
print “\t\t\”{#DISK}\”:\”$_disk\”\n”;
print “\n\t}\n”;
}

print “\n\t]\n”;
print “}\n”;

Zabbix userparameter_linux_disks.conf:

# See https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
#
# reads completed successfully
UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | egrep $1 | head -1 | awk ‘{print $$4}’
# sectors read
UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | egrep $1 | head -1 | awk ‘{print $$6}’
# time spent reading (ms)
UserParameter=custom.vfs.dev.read.ms[*],cat /proc/diskstats | egrep $1 | head -1 | awk ‘{print $$7}’
# writes completed
UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | egrep $1 | head -1 | awk ‘{print $$8}’
# sectors written
UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | egrep $1 | head -1 | awk ‘{print $$10}’
# time spent writing (ms)
UserParameter=custom.vfs.dev.write.ms[*],cat /proc/diskstats | egrep $1 | head -1 | awk ‘{print $$11}’
# I/Os currently in progress
UserParameter=custom.vfs.dev.io.active[*],cat /proc/diskstats | egrep $1 | head -1 | awk ‘{print $$12}’
# time spent doing I/Os (ms)
UserParameter=custom.vfs.dev.io.ms[*],cat /proc/diskstats | egrep $1 | head -1 | awk ‘{print $$13}’

Full article there:

http://www.denniskanbier.nl/blog/monitoring/monitoring-disk-io-using-zabbix/

FFMPEG on CentOS

rpm –import http://packages.atrpms.net/RPM-GPG-KEY.atrpms
vi /etc/yum.repos.d/atrpms.repo
[atrpms]
name=Fedora Core $releasever – $basearch – ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=0

[atrpms-testing]
name=Fedora Core $releasever – $basearch – ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=0`

yum --enablerepo=atrpms* install ffmpeg

cPanel disable SSL 3

If you are afraid of POODLE Attack, you should disable SSL v3. You can use this ansible playbook:


– hosts: test
remote_user: root

tasks:
– lineinfile: dest=/usr/local/apache/conf/includes/pre_main_global.conf line=”#Turn off SSL v3 support\nSSLProtocol All -SSLv2 -SSLv3\nSSLHonorCipherOrder On\n” insertafter=BOF
– name: rebuild httpd confs
command: /scripts/rebuildhttpdconf
notify:
– restart httpd
– name: ensure apache is running
service: name=httpd state=started

handlers:
– name: restart httpd
service: name=httpd state=restarted