Simple monitoring – Chương trình monitor mạng đơn giản.

Chương trình được viết bằng python

Hướng dẫn cài đặt:

Cài đặt python3, và các gói cần thiết
yum install epel-release -y & yum install python36 python36-pip.noarch -y && pip3 install requests

Cách chạy app, sau khi thay cấu hình trong file config.py
cd <đường dẫn thư mục app>
python3 monitor_simple.py

Cách thiết lập chạy mỗi phút 1 lần:
crontab -l
Thêm vào dòng sau:
* * * * * /usr/bin/python3 <đường dẫn file monitor_simple.py>

Download:

https://github.com/khachuy2705/monitor_simple

Thêm custom rule firewall cho ESXi

Tương tự ufw, iptable của centos, ubuntu, ESXi cũng có firewall của riêng mình. Mặc định ESXi đã tạo sẵn 1 số rule, chúng ta có thể thao tác với các rule này trên web quản trị Tuy nhiên một có một số hạn chế như: chỉ đi ra ngoài qua outgoing port mặc định: 80, 22, 443.v.v Khi đó cần tạo thêm rule mới cho nhu cầu của mình. Cách mở thêm rule như sau: SSH vào máy chủ ESXi, sửa file /etc/vmware/firewall/custom.xml nếu không có thì tạo mới. Thêm rule vào theo định dạng sau:
<ConfigRoot>
  <service id='0100'>
    <id>sshClient-2222</id>
    <rule>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>2222</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0101'>
    <id>NFSClient-2049</id>
    <rule>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>2049</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

</ConfigRoot>
Sau đó refresh lại firewall
esxcli network firewall refresh
 

Notice: ob_end_flush(): failed to send buffer of zlib output compression (0) in /home/devopsvn/public_html/wp-includes/functions.php on line 5427