Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Thursday, March 22, 2018

Menangani server zimbra yang melakukan flooding dengan src port 11211(Memcached)

Bismillah ,

Kemarin mail server kami melakukan flooding dengan traffic yang bisa sampai 1Gbps

dan membuat semua interface di mikrotik meng-restart (disable-enable) sehingga jaringan menjadi down . Awal kami sempat kebingungan apa penyebab semua interface router tiba tiba disable enable sendiri , langkah awal kami coba untuk melakukan troubleshooting dengan cara trial error melepas satu satu kabel yang terkoneksi langsung ke router , dan ketika kami melepas kebel yang mengarah ke mail server kabel interface router kembali normal (problem ada di mail server ) .

hasil di mail server terdapat historical lonjakan trafic yang sanga besar dari interface  ,



kami simpulkan penyebab interface router mendisable/enable secara tiba tiba karena kriman flooding traffic dari mail server. untuk menangani nya langkah awal kami install iftop yang nanti nya di gunakan untuka menganalisa traffik yang lewat di interface mail server .



dapat di lihat flooding zimbra ini dengan src port 11211 dan jka kita cari port 11211  merupakan port memcached , flooding port tersebut merupakan jenis serangan baru yang pertama publish dari cloudflare  https://blog.cloudflare.com/memcrashed-major-amplification-attacks-from-port-11211/ di publish tgl 27 Feb 2018 by Marek Majkowski , jadi  problem ada di memchaced zimbra ( https://wiki.zimbra.com/wiki/Blocking_Memcached_Attack ) .

sesuai dengan solusi di wiki zimbra di atas maka kita akan aktifkan firewall di ubuntu dan bind memcached hanya untuk localhost,
su - zimbra
/opt/zimbra/bin/zmprov ms `zmhostname` zimbraMemcachedBindAddress 127.0.0.1 
/opt/zimbra/bin/zmprov ms `zmhostname` zimbraMemcachedClientServerList 127.0.0.1

zmmemcachedctl restart

aktifkan firewall di ubuntu
root@mail:~# ufw enable

buat file untuk rule firewal zimbra
root@mail:~# pico /etc/ufw/applications.d/zimbra

buat rule seperti berikut di file /etc/ufw/applications.d/zimbra
[Zimbra]
title=Zimbra Collaboration Server
description=Open source server for email, contacts, calendar, and more.
ports=22,25,80,110,143,161,389,443,465,514,587,993,995,7071,8443,11211/tcp

port di atas adalah port port yang di butuhkan untuk zimbra dan server (rule di atas adalah white list port ) jadi sebelum anda enable rule nya pastikan port ssh anda sudah di masukan dalam whitelist.
allow zimbra
 root@mail:~# ufw allow zimbra

drop semua koneksi ke port 11211
root@mail:~# ufw deny 11211

Accept koneksi ke 11211 dari localhost
root@mail:~# ufw allow from 127.0.0.1 to any port 11211

aktifkan ufw
root@mail:~# ufw enable

untuk melihat status ufw
root@mail:~# ufw status verbose
WARN: "Invalid ports in profile 'Zimbra'"
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To Action From
-- ------ ----
22,25,80,110,143,161,389,443,465,514,587,993,995,7071,11211/tcp (Zimbra) ALLOW IN Anywhere 
11211 DENY IN Anywhere 
11211 ALLOW IN 127.0.0.1 
5666 ALLOW IN Anywhere 
8443 ALLOW IN Anywhere 
22,25,80,110,143,161,389,443,465,514,587,993,995,7071,11211/tcp (Zimbra (v6)) ALLOW IN Anywhere (v6) 
11211 (v6) DENY IN Anywhere (v6) 
5666 (v6) ALLOW IN Anywhere (v6) 
8443 (v6) ALLOW IN Anywhere (v6)

root@mail:~#

grafik setelah beberapa hari dilakukan penanganan di atas



trafik kembali normal , alhamdulillah :)

referensi

https://blog.cloudflare.com/memcrashed-major-amplification-attacks-from-port-11211/

https://wiki.zimbra.com/wiki/Blocking_Memcached_Attack

https://blog.grs.gr/language/en/protect-zimbra-from-memcached-attack/

Friday, March 24, 2017

INTEGRASI FREERADIUS + LDAP-ZIMBRA + MIKROTIK DENGAN DALORADIUS SEBAGAI USER MANAJEMEN NYA

Bismillah ,.. insyaallah hari ini saya akan mencoba menulis tentang freeradius yang saya coba integrasikan dengan mikrotik (untuk login di hotspot mikrotik) , backend ldap zimbra dan untuk pencatatan report nye menggunakan daloradius , untuk zimbra nya saya anggap sudah berjalan dengan normal dan kita tinggal mengecek parameter ldap nya , ok bismillah , pertama kita update dan upgrade server ubuntu nya dahulu (saya menggunakan ubuntu server 14.04 lts , tidak saya tulis di judul karena terlalu panjang :) )

Update server ubuntu
root@ubuntu:~# apt-get update

root@ubuntu:~# apt-get upgrade

Install LAMP server (untuk daloradius nya)
root@ubuntu:~# apt-get install apache2 php5 mysql-server

Install Freeradius dengan Modul yang di butuhkan

karena kita akan menggunakan ldap zimbra sebagai backend user nya dan daloradius sebagai reporting nya maka kita install freeradius-mysql dan freeradius-ldap
root@ubuntu:~# apt-get install freeradius freeradius-mysql freeradius-utils freeradius-common freeradius-ldap
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libfreeradius2 libltdl7 libperl5.18
Suggested packages:
freeradius-postgresql freeradius-krb5
The following NEW packages will be installed:
freeradius freeradius-common freeradius-ldap freeradius-mysql
freeradius-utils libfreeradius2 libltdl7 libperl5.18
0 upgraded, 8 newly installed, 0 to remove and 3 not upgraded.
Need to get 895 kB of archives.
After this operation, 4094 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

Install Modul / library PHP yang di butuhkan daloradius

pengalaman saya sebelum install di ubuntu 14.04 di ubuntu 12 kita akan memukan kendala ketika install dalo radius versi terbaru dengan php 5.3 , beberapa library sangat sulit diinstall seperti php-pear dan php-db
root@ubuntu:~# apt-get install php5-gd php-db php-pear
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0
libjpeg-turbo8 libjpeg8 libtiff5 libvpx1 libxpm4
Suggested packages:
libgd-tools php5-dev
The following NEW packages will be installed:
fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0
libjpeg-turbo8 libjpeg8 libtiff5 libvpx1 libxpm4 php-db php-pear php5-gd
0 upgraded, 13 newly installed, 0 to remove and 3 not upgraded.
Need to get 2622 kB of archives.
After this operation, 10.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Download dan ekstrak  daloradius 

disini saya menggunakan daloradius versi daloradius-0.9-9.tar.gz  , bisa di download di sini  kemudian ekstrak , untuk memudahkan silahkan di rename folder nya
root@ubuntu:/var/www/html# tar zxvf daloradius-0.9-9.tar.gz
root@ubuntu:/var/www/html# mv daloradius-0.9-9 daloradius

Buat database dan import skema database dari daloradius
root@ubuntu:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.54-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create databases radius;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases radius' at line 1
mysql> CREATE DATABASE radius;
Query OK, 1 row affected (0.00 sec)

mysql> quit
Bye
root@ubuntu:~#

import skema database daloradius
root@ubuntu:/var/www/html/daloradius/contrib/db# mysql -u root -p radius < fr2-mysql-daloradius-and-freeradius.sql 
Enter password:
root@ubuntu:/var/www/html/daloradius/contrib/db#

Konfigurasi

# edit file radiusd.conf
root@ubuntu:/var/www/html/daloradius# pico /etc/freeradius/radiusd.conf

fauth = no <---- ( Ubah menjadi “yes” )
authbadpass = no <----( Ubah menjadi “yes” )
authgoodpass = no<----( Ubah menjadi “yes” )

proxy_request = yes <----( Ubah menjadi “no” )

#$INCLUDE sql.conf <---- ( Hilangkan # )

# edit file sql.conf
root@ubuntu:/var/www/html/daloradius# pico /etc/freeradius/sql.conf

# Connection info:
server = “localhost”
#port = 3306
login = “root”
password = “” <----(password root mysql anda)
# Database table configuration for everything except Oracle
radius_db = “radius”
#readclient = yes –> ( Hilangkan tanda pagar # )

#buat baru file clients.conf , yang lama di backup dulu
root@ubuntu:/etc/freeradius# mv clients.conf clients.conf.old

root@ubuntu:/var/www/html/daloradius# pico /etc/freeradius/clients.conf

client 192.168.10.0/29 {   <-- ganti ip dengan network ip server radius
secret = test123ok    <--  ini yang nanti di set di mikrotik nya
shortname = private-network-akses
}

#edit file site-enabled.conf
root@ubuntu:/etc/freeradius# pico sites-enabled/default

uncomment   di beberapa baris  ,

  1. authorize    --> uncomment bagian ldap#
    # The ldap module will set Auth-Type to LDAP if it has not
    # already been set
    ldap

  2. accounting   --> uncomment bagian sql#
    # Log traffic to an SQL database.
    #
    # See "Accounting queries" in sql.conf
    sql

  3. session --> uncoment bagian sqlsession {
    radutmp#
    # See "Simultaneous Use Checking Queries" in sql.conf
    sql
    }

  4. post-auth --> uncomment bagian sql dan ldap#
    # After authenticating the user, do another SQL query.
    #
    # See "Authentication Logging Queries" in sql.conf
    sql#
    # Instead of sending the query to the SQL server,
    # write it into a log file.
    #
    # sql_log#
    # Un-comment the following if you have set
    # 'edir_account_policy_check = yes' in the ldap module sub-section of
    # the 'modules' section.
    #
    ldap


kemudian simpan ,

edit file  /etc/freeradius/modules/ldap  untuk menyessuaikan paramater ldap , contoh untuk kasus saya adalah ldap-zimbra
root@ubuntu:~# pico /etc/freeradius/modules/ldap

ldap {
#
# Note that this needs to match the name in the LDAP
# server certificate, if you're using ldaps.
server = "192.168.112.211"
identity = "uid=zimbra,cn=admins,cn=zimbra"
password = passwordldapzimbra
#basedn = "ou=people,dc=domainkamu,dc=com"
basedn = "ou=people,dc=domainkamu,dc=com"
filter = "(uid=%{%{Stripped-User-Name}:-%{User-Name}})"
#base_filter = "(objectclass=radiusprofile)"
#identity = "cn=admin,o=My Org,c=UA"
#password = mypass
#basedn = "o=My Org,c=UA"
#filter = "(uid=%{%{Stripped-User-Name}:-%{User-Name}})"
#base_filter = "(objectclass=radiusprofile)"

 

untuk cek parameter ldap di zimbra bisa dengn perintah

" zmlocalconfig -s zimbra_ldap_password   " dengan user zimbra.

restart service freeradius
root@ubuntu:~# service freeradius restart

# Konfigurasi mikrotik

ke radius kemudian tambah radius isikan

address = ip server radius nya

secret = yang sudah di definisikan di clients.conf (di kasus saya testing123ok)



kemudian ke hotspot server profile bagian radius  centang  use radius dan accounting



Testing user Mysql

akses ke http://ipservernya/daloradius

user: administrator

password : radius

ke config --> Maintenance --> Test user connectivity  , sebelum nya add user terlebih dahulu





Testing User LDAP



contoh user ldap yang aktif



 

selamat mencoba semoga bermanfaat ,... :)

referensi :

http://blog.unpatti.ac.id/ridom/computer-networking/mikrotik-hotspot-dengan-freeradius-dan-daloradiu

http://runnov.blogs.uny.ac.id/2016/08/06/impelementasi-dan-konfigurasi-mikrotik-hotspot-freeradius-mysql-dan-ldap/

Daloradius error " DB Error : Extension Not found "

Beberapa hari yang lalu saya mencoba meninstall daloradius , installasi lancar hanya ketika terkahir di coba setelah login dapat pesan "Database connection error   Error message DB Error : Extension Not found "  seerti gambar berikut

  , solusi nya  ternyata cukup install php-myadmin saja ternya , menurut team support dari  daloradius nya  https://sourceforge.net/p/daloradius/discussion/684102/thread/7ea43f3c/  , jadi langsung saja  apt-get install
root@ubuntu:~# apt-get install phpmyadmin

dan hasil nya , OK   :)



 

semoga bermanfaat  :)

Monday, August 22, 2016

Install smokeping di ubuntu 14.04

Sedikit Penjelasan

Smokeping adalah tool untuk memonitoring latency pada sebuah jaringan , smokeping melakukan pematauan latency jaringan kemudian melakukan pencatatan kedalam bentuk diagram grafis (fitur graph nya hampir mirip cacti) , latency dalam jaringan sendiri adalah waktu yang di butuhkan paket data untuk berpindah dari server ke client atau sebalik nya ,
nah biasanya jika kita membicarakan masalah kecepatan jaringan , akan ada 3 istilah yang muncul,

  • Throughput : troughput adalah jumlah aktual dari data yang mengalir melalui sambungan

  • Bandwidth : lebar pita (atau biasanya saya sebut lebar pipa nya)

  • Latency  : kaya yang saya sebutkan di atas


dari 3 istilah di atas kalo saya analogikan mungkin bisa seperti berikut :

misal Throughput itu adalah jumalah mobil yang lewat di suatu jalan , Bandwidth adalah lebar jalan sedangkan Latency adalah kecepatan laju si mobil , jadi jika  Seumpama ada sebuah perusahaan ingin mengirim 4 truk yang membawa peti kemas ke suatu tempat melalui jalur darat. Perusahaan tersebut punya dua jalur pilihan pengiriman , pertama truk-truk tersebut melalui sebuah jalan perbukitan dengan lebar 4 jalur. Tetapi truk-truk tersebut hanya mampu berjalan pada kecepatan 40 Km/jam karena medannya perbukitan.

Cara kedua, perusahaan itu mengirim 4 truk melalui jalan lain yang hanya muat 2 jalur. Meski jalur tersebut lebih sempit, tapi jalanannya datar dan truk tersebut bisa melaju kencang hingga 100 Km/jam.

Nah, kira-kira mana yang lebih cepat sampai?

Itulah sebabnya kenapa ada orang yang langganan internet dengan bandwidth besar, tapi untuk nonton video di YouTube masih suka putus-putus. Karena meski bandwidth’nya besar, tapi latency’nya terhambat.

beberapa hal yang mempengaruhi latency menjadi lambat

  • Buruknya kualitas saluran, bila menggunakan media kabel, mungkin kabelnya sudah tua. Bila menggunakan media wireless, mungkin ada gangguan sinyal (distorsi sinyal atau interfrensi)

  • Saluran terlalu penuh (overload). Hal ini sering dialami oleh provider. Analoginya sama saja dengan jalan tol yang penuh. Siapa yang bisa ngebut disitu sekalipun jalurnya lebar?

  • Jarak yang terlalu jauh, dan tidak ada penguat sinyal


nah perbedaan latency antar sambungan ini juga yang dapat menciptakan bottlenecks ( bisa search sendiri di google apa itu bottlenecks ) CMIIW

Installasi

di ubuntu smokeping sudah ada di repository jadi bisa langsung APT -GET  :) , untuk notifikasi bisa menggunakan sendmail atau mail postfix relay , tapi dalam untuk sekarang akan saya lewati dulu
root@serveraldy:~# apt-get install smokeping -y

Kofigurasi

*) link-kan smokeping apache config ke folder /etc/apache2/conf-available

root@serveraldy:~# cd /etc/apache2/conf-available/
root@serveraldy:/etc/apache2/conf-available# ln -s /etc/smokeping/apache2.conf smokeping.conf

*) Enable config dan mod_cgi

root@serveraldy:/etc/apache2/conf-available# a2enconf smokeping
root@serveraldy:/etc/apache2/conf-available# a2enmod cgid

*) Tambahkan beberapa host untuk di monitor , misal

root@serveraldy:/etc/apache2/conf-available# pico /etc/smokeping/config.d/Targets


*** Targets ***

probe = FPing

menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
Here you will learn all about the latency of our network.

+ Local

menu = Local
title = Local Network
#parents = owner:/Test/James location:/

++ LocalMachine

menu = Local Machine
title = This host
host = localhost
#alerts = someloss

++ Web_Server_1
menu = google.com
title = google.com
host = google.com

*) Restart smokeping dan apache nya

root@serveraldy:/etc/apache2/conf-available# service smokeping restart
* Shutting down latency logger daemon smokeping [ OK ]
* Starting latency logger daemon smokeping [ OK ]
root@serveraldy:/etc/apache2/conf-available# service apache2 restart

Test smokeping

silahkan akses http://alamatserver/cgi-bin/smokeping.cgi

bebrapa tambahan , jika ketika di akses di muncul browser error Service Unavailable itu menandakan modul fastcgi belum terinstall di webserver silahkan install dengan cara

root@serveraldy:/etc/apache2/conf-available# sudo apt-get install libapache2-mod-fcgi

Screenshot from 2016-08-21 19-58-29

Screenshot from 2016-08-21 19-58-43

selamat mencoba , smoga bermanfaat :)

referensi :

http://olivermarshall.net/install-smokeping-on-ubuntu-14-0
http://compnetworking.about.com/od/speedtests/a/network_latency.htm
http://oss.oetiker.ch/smokeping/
https://heckermadiun.wordpress.com/pengertian-latency-dan-jite

Monday, August 15, 2016

Install Nagios Remote Plugin Executor di ubuntu server 14.04

Bismillah...

NRPE atau Nagios Remote Plugin Executor  adalah  tools yang di gunakan untuk mengeksekusi nagios plugin di remote client system  , dengan tools ini dan nagios plugin kita bisa mengetahui free disk , system load , total process dari server yang kita monitor  contoh diagram cara kerja NRPE  nrpe

berikut langkah memasang NRPE dengan beberapa plugin nagios di ubuntu 14.04 Lts,

Install NRPE dan Nagios Plugin
root@ubuntu:/etc# apt-get install nagios-nrpe-server nagios-plugins
The following extra packages will be installed:
libarchive13 libgmp10 libgssglue1 libldb1 liblzo2-2 libnet-snmp-perl
libnettle4 libperl5.18 libsensors4 libsmbclient libsnmp-base libsnmp30
libtalloc2 libtdb1 libtevent0 libtirpc1 libwbclient0 nagios-plugins-basic
nagios-plugins-common nagios-plugins-standard python-crypto python-ldb
python-samba python-talloc python-tdb rpcbind samba-common samba-common-bin
samba-libs smbclient snmp whois
Suggested packages:
lrzip libcrypt-des-perl libdigest-hmac-perl libio-socket-inet6-perl
lm-sensors snmp-mibs-downloader nagios3 icinga nagios-plugins-contrib
postfix sendmail-bin exim4-daemon-heavy exim4-daemon-light python-crypto-dbg
python-crypto-doc heimdal-clients cifs-utils
The following NEW packages will be installed:
libarchive13 libgmp10 libgssglue1 libldb1 liblzo2-2 libnet-snmp-perl
libnettle4 libperl5.18 libsensors4 libsmbclient libsnmp-base libsnmp30
libtalloc2 libtdb1 libtevent0 libtirpc1 libwbclient0 nagios-nrpe-server
nagios-plugins nagios-plugins-basic nagios-plugins-common
nagios-plugins-standard python-crypto python-ldb python-samba python-talloc
python-tdb rpcbind samba-common samba-common-bin samba-libs smbclient snmp
whois
0 upgraded, 34 newly installed, 0 to remove and 132 not upgraded.
Need to get 10.2 MB of archives.
After this operation, 47.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Konfigurasi NRPE

edit file nrpe.cfg
root@ubuntu:/etc# pico /etc/nagios/nrpe.cfg

search dengan menggunakan Ctrl+W  " allowed_hosts= " , kemudian tambahkan ip server nagios nya

nrpe

kemudian check command dari nrpe nya , sesuaikan dengan server yang akan di monitor,misal pada disk kita bisa chek dengan fdisk -l , kemudian tentukan partisi mana yang akan di monitor
root@ubuntu:/etc# fdisk -l

Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders, total 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006c35e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 23437311 11717632 82 Linux swap / Solaris
/dev/sda2 23439358 209713151 93136897 5 Extended
/dev/sda5 23439360 29296639 2928640 83 Linux
/dev/sda6 29298688 209713151 90207232 83 Linux


root@ubuntu:/etc# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 85G 77G 4,1G 95% /
none 4,0K 0 4,0K 0% /sys/fs/cgroup
udev 3,0G 4,0K 3,0G 1% /dev
tmpfs 597M 500K 597M 1% /run
none 5,0M 0 5,0M 0% /run/lock
none 3,0G 0 3,0G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/sda5 2,7G 754M 1,8G 30% /boot
root@ubuntu:/etc#

nrpe-1

misal jika ingin monitor partisi swap tinggal tambahkan baris berikut,
command[check_swap]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda1

Start/Restart NRPE
root@ubuntu:/etc# service nagios-nrpe-server restart 
* Stopping nagios-nrpe nagios-nrpe [ OK ]
* Starting nagios-nrpe nagios-nrpe [ OK ]
root@ubuntu:/etc#

Konfigurasi Server Nagios

tambahkan commad check_nrpe di command.cfg nagios (di kasus saya, saya mengunakan nagios core Version 4.0.8 ) ,
root@serveraldy:~# pico /usr/local/nagios/etc/objects/commands.cfg
kemudian tambahkan baris berikut
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
terakhir tambahkan service yang akan di monitor
# OPen Library #
###############################################################
define host{
use linux-server
host_name openlibrary.assyifa
alias openlibrary.assyifa
address 192.168.223.10
contacts nagiosadmin
contact_groups admins
max_check_attempts 5
check_period 24x7
notification_interval 15
first_notification_delay 0
notification_period 24x7
notification_options d,u,r,f,s
notifications_enabled 1
check_interval 5
icon_image
icon_image_alt
vrml_image
}
define service{
use local-service
host_name openlibrary.assyifa
service_description PING
contact_groups admins
check_command check_ping!100.0,20%!500.0,60%
notifications_enabled 1
}
define service{
use local-service
host_name openlibrary.assyifa
service_description SSH
#max_check_attempts 5
#check_interval 1
#retry_interval 1
#contacts nagiosadmin
#contact_groups admins
notifications_enabled 1
check_command check_ssh
}
define service{
use local-service
host_name openlibrary.assyifa
service_description HTTP
contact_groups admins
check_command check_http
notifications_enabled 1
}
define service{
use local-service
host_name openlibrary.assyifa
service_description Root Partition
contact_groups admins
check_command check_nrpe!check_hda1
}
define service{
use local-service
host_name openlibrary.assyifa
service_description Total Processes
contact_groups admins
check_command check_nrpe!check_total_procs
}
define service{
use generic-service
host_name openlibrary.assyifa
service_description Current Load
contact_groups admins
check_command check_nrpe!check_load
}
define service{
use local-service
host_name openlibrary.assyifa
service_description Swap Usage
contact_groups admins
check_command check_nrpe!check_swap
}
define service{
use generic-service
host_name openlibrary.assyifa
service_description Zombie
contact_groups admins
check_command check_nrpe!check_zombie_procs
}

restart service nagios
root@serveraldy:~# service nagios restart
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
root@serveraldy:~#

berikut tampilan hasil nya

Selection_137

semoga bermanfaat , selamat mencoba :)

referensi :

http://tecadmin.net/install-nrpe-on-ubuntu/#

 

Friday, August 12, 2016

Memasang Nagmap Plugin di Nagios Core

Bismillah ,...

hari ini insyaallah saya akan sedikit menjelaskan cara memasang nagmap nagios plugin kedalam NagiosCore , saya menggunakan Version 4.0.8 berjalan di Ubuntu 14.04 Lts , ok  ..

saya anggap nagios sudah running dan kita sudah menambahkan host dan service untuk di monitoring,

pertama kita download dulu plugin nag map nya , bisa di web ini [ Nagmap 1.0 ]  untuk versi update nya ada di sini https://github.com/hecko/nagmap

root@serveraldy:/# cd /var/www/html/
root@serveraldy:/var/www/html# wget aldy.alshifacharity.com/wp-content/uploads/2016/08/nagmap-1.0.tar.gz
--2016-08-11 17:40:02-- http://aldy.alshifacharity.com/wp-content/uploads/2016/08/nagmap-1.0.tar.gz
Resolving aldy.alshifacharity.com (aldy.alshifacharity.com)... 192.168.222.227
Connecting to aldy.alshifacharity.com (aldy.alshifacharity.com)|192.168.222.227|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9584 (9,4K) [application/x-gzip]
Saving to: ‘nagmap-1.0.tar.gz’
100%[=====================================================================================================================>] 9.584 --.-K/s in 0s
2016-08-11 17:40:02 (37,1 MB/s) - ‘nagmap-1.0.tar.gz’ saved [9584/9584]

 

kemudian ekstrak

root@serveraldy:/var/www/html# tar -xvzf nagmap-0.11.tar.gz
root@serveraldy:/var/www/html# ls
nagmap nagmap-1.0.tar.gz
root@serveraldy:/var/www/html#

edit config.php

root@serveraldy:/var/www/html# pico nagmap/
call.php config.php favicon.ico index.php marker.php nagios_cfg.php status.php THANKS
CHANGELOG debug.php functions.php INSTALL moire.php README style.css
root@serveraldy:/var/www/html# pico nagmap/config.php

silahkan ikuti petunjuk nya dan sesuaikan

Screenshot from 2016-08-11 19-40-53

save  dengan Ctrl + x kemudian  Y  terus Enter

terakhir kita tambahkan host yang akan di mark ke Map , misal seperti berikut :

root@serveraldy:/var/www/html# pico /usr/local/nagios/etc/switch/switch.cfg

Screenshot from 2016-08-15 16-49-02

sampai sini map sudah bisa di akses lewat browser di http://ipserver/nagmap  , yang kurang lebih tampilan nya sperti berikut

Screenshot from 2016-08-11 19-57-45

terakhir ,  kita coba tambahkan menu Nagmap di site nagios ,   edit halaman side.php kemudian tambahkan beberapa baris html code

root@serveraldy:~# locate side.php
/root/nagios-4.0.8/html/side.php
/usr/local/nagios/share/side.php
/usr/share/nagios3/htdocs/side.php
root@serveraldy:~# pico /usr/local/nagios/share/side.php

Screenshot from 2016-08-11 20-03-42

sesuaikan ip dengan server anda , save dan test...

Screenshot from 2016-08-11 20-07-33

referensi :

https://github.com/hecko/nagmap

http://ardnetwork.com/wpmu/blog/integration-nagios-with-nagmap/

http://www.linuxscrew.com/2012/07/02/nagios-map-geolocation/