htmonitor install

htmonitor install

  1. tornado install

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    [root@alarmcenter ~]# python -V
    Python 2.7.13
    [root@alarmcenter ~]# pip -V
    pip 9.0.1 from /usr/local/python27/lib/python2.7/site-packages (python 2.7)

    [root@alarmcenter ~]# cat > requirements.txt <<EOF
    > tornado>=4.2
    > torndb==0.3 # 0.3 is ok, not sure if other versions can work.
    > requests>=2.7.0
    > six>=1.9.0
    > stevedore>=1.5.0
    > EOF
    [root@alarmcenter ~]# pip install -r requirements.txt
  2. mysql install

    1
    2
    3
    [root@alarmcenter ~]# yum -y install mariadb-server
    [root@alarmcenter ~]# systemctl start mariadb
    [root@alarmcenter ~]# systemctl enable mariadb
  3. 下载htmonitor

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    [root@alarmcenter ~]# cd /mnt/web/
    [root@alarmcenter web]# git clone https://github.com/smallasa/hmonitor.git

    [root@alarmcenter web]# cd hmonitor/
    [root@alarmcenter hmonitor]# mysql < db.sql
    [root@alarmcenter hmonitor]# mysql -e "show tables in hmonitor;"
    +-----------------------+
    | Tables_in_hmonitor |
    +-----------------------+
    | ALERT_FILTER |
    | ALERT_MSG |
    | AUTOFIX_BINDING |
    | AUTOFIX_LOG |
    | HM_TRIGGER |
    | TRIGGER_EVENTS |
    | USERS |
    | USERS_TRIGGER_BINDING |
    +-----------------------+

    [root@alarmcenter hmonitor]# mysql
    MariaDB [(none)]> grant all privileges on hmonitor.* to 'hmonitor'@'localhost' identified by 'htmonitor' with grant option;
    MariaDB [(none)]> flush privileges;