Menjalankan TMUX Langsung Dengan Perintah Tertentu dan menjalankanya di crontab

26.9.19 ilham.sp 0 Comments

tmux new-session -d -s nama_sesi 'perintah'
contoh :
tmux new-session -d -s ngeping_aja 'ping'
Kadang kita perlu menjalankan peritah tertentu pada TMUX, normalnya kita akan membuka TMUX terlebih dahulu dengan perintah "tmux", setelah tmux terbuka baru kita laksanakan operasi yang ingin dilakukan. Namun akan sedikit merepotkan bila dibutuhkan menjalakan beberapa operasi dengan banyak tmux, apalagi bila operasi tersebut ingin dijadikan salah satu cronjob, dengan script diatas memungkinkan menjalankan operasi dalam tmux dengan satu baris perintah, pun memudahkan bila dijadikan script yang akan dijalankan pada cronjob. Jangan lupa bila menjalankan script, script tersebut harus diberikan permisi eksekusi terlebih dahulu.

Seting di crontab
untuk mengedit perintah cronjob ketikan perintah

crontab -e

ketik "i" untuk edit cronjob, tambahkan perintah yang akan dijalankan.

contoh :

@reboot sleep 300 && tmux new-session -d -s tmux_adms 'ping'

perintah diatas maksudnya,menjalankan perintah "sleep 300" memberikan jeda waktu 5 menit (300 detik=5menit), kemudia menjalankan perintah ping di dalam tmux setelahnya.

untuk variasi perintah crobjob lainya dapat di pelajari pada

0 komentar:

20 Command Line Tools to Monitor Linux Performance - Part 2

22.9.19 ilham.sp 0 Comments

11. Monit – Linux Process and Services Monitoring

Monit is a free open source and web based process supervision utility that automatically monitors and managers system processes, programs, files, directories, permissions, checksums and filesystems.
It monitors services like Apache, MySQL, Mail, FTP, ProFTP, Nginx, SSH and so on. The system status can be viewed from the command line or using it own web interface.

12. NetHogs – Monitor Per Process Network Bandwidth

NetHogs is an open source nice small program (similar to Linux top command) that keeps a tab on each process network activity on your system. It also keeps a track of real time network traffic bandwidth used by each program or application.

13. iftop – Network Bandwidth Monitoring

iftop is another terminal-based free open source system monitoring utility that displays a frequently updated list of network bandwidth utilization (source and destination hosts) that passing through the network interface on your system. iftop is considered for network usage, what ‘top‘ does for CPU usage. iftop is a ‘top‘ family tool that monitor a selected interface and displays a current bandwidth usage between two hosts.

14. Monitorix – System and Network Monitoring

Monitorix is a free lightweight utility that is designed to run and monitor system and network resources as many as possible in Linux/Unix servers. It has a built in HTTP web server that regularly collects system and network information and display them in graphs. It Monitors system load average and usagememory allocationdisk driver healthsystem servicesnetwork portsmail statistics (SendmailPostfixDovecot, etc), MySQL statistics and many more. It designed to monitor overall system performance and helps in detecting failures, bottlenecks, abnormal activities etc.

15. Arpwatch – Ethernet Activity Monitor

Arpwatch is a kind of program that is designed to monitor Address Resolution (MAC and IP address changes) of Ethernet network traffic on a Linux network. It continuously keeps watch on Ethernet traffic and produces a log of IP and MAC address pair changes along with a timestamps on a network. It also has a feature to send an email alerts to administrator, when a pairing added or changes. It is very useful in detecting ARP spoofing on a network.

16. Suricata – Network Security Monitoring

Suricata is an high performance open source Network Security and Intrusion Detection and Prevention Monitoring System for LinuxFreeBSD and Windows.It was designed and owned by a non-profit foundation OISF (Open Information Security Foundation).

17. VnStat PHP – Monitoring Network Bandwidth

VnStat PHP a web based frontend application for most popular networking tool called “vnstat“. VnStat PHPmonitors a network traffic usage in nicely graphical mode. It displays a total IN and OUT network traffic usage in hourlydailymonthly and full summary report.

18. Nagios – Network/Server Monitoring

Nagios is an leading open source powerful monitoring system that enables network/system administrators to identify and resolve server related problems before they affect major business processes. With the Nagios system, administrators can able to monitor remote Linux, Windows, Switches, Routers and Printers on a single window. It shows critical warnings and indicates if something went wrong in your network/server which indirectly helps you to begin remediation processes before they occur.

19. Nmon: Monitor Linux Performance

Nmon (stands for Nigel’s performance Monitor) tool, which is used to monitor all Linux resources such as CPU, Memory, Disk Usage, Network, Top processes, NFS, Kernel and much more. This tool comes in two modes: Online Mode and Capture Mode.
The Online Mode, is used for real-time monitoring and Capture Mode, is used to store the output in CSV format for later processing.

20. Collectl: All-in-One Performance Monitoring Tool

Collectl is a yet another powerful and feature rich command line based utility, that can be used to gather information about Linux system resources such as CPU usage, memory, network, inodes, processes, nfs, tcp, sockets and much more.
We would like to know what kind of monitoring programs you use to monitor performance of your Linux servers? If we’ve missed any important tool that you would like us to include in this list, please inform us via comments and please don’t forget to share it.

Summer :

0 komentar:

Setting NTP di Centos 7

22.9.19 ilham.sp 0 Comments

NTP adalah protocol yang berfungsi untuk mengsinkronisasikan waktu pada suatu komputer yang akurat melalui internet

Setelah itu kita install terelbih dahulu NTP di centos servernya... cara install nya dengan menggunakan perintah "yum install ntp -y"... dan tunggu sebentar...

Setelah terinstall ntpnya akan terlihat packet yang terinstall, dan kalian bisa lihat gambar diatas...

Setelah itu kalian buka web "" untuk melihat server pool nya kalian bisa pilih indonesia. disini kalian harus cepat konfigurasinya karena setiap 10 menit maka server pool nya akan terganti automatic dengan server pool lain.

setelah itu kalain masuk ke direktori "etc/ntp.conf" dengan menggunakan command "nano /etc/ntp.conf"....

Kalian tambahkan tanda pager script yang sudah saya tandai pada gambar diatas...

Maka nanti hasilnya akan seperti gambar diatas....

Kalian copy pool zone ke dalam direktori "/etc/ntp.conf", kalian bisa lihat contoh nya seperti gambar diatas

Setelah tadi mengatur file "ntp.conf" , sekarang kalian setting timezone nya menggunakan perintah "timedatectl set-timezone Asia/Jakarta" lalu kalian "enter"

Setelah itu kita tambahkan service ntp pada firewall nya dengan perintah "firewall-cmd --add-service=ntp --permanent"...

Setelah itu kita restart firewallnya menggunakan perintah "firewall-cmd --reload" dan pastikan setiap command nya ada tulisan "scripts"....

Setelah itu kita start, aktifkan dan check status ntpnya dengan perintah :
"sytemctl start ntpd"
"systemctl enable ntpd"
"systemctl status ntpd"
masukan satu persatu, dan kalian harus pastikan status nya harus running dan aktif....

Setelah itu kita coba verifikasi dengan menggunakan perintah "ntpq -p" dan menggunakan perintah "date -R" untuk melihat tanggal dan jamnya.

Sumber :

0 komentar: