Build React Native App (4) - Redux, Jest, and NativeBase

Image
From this blog, typescript feature will be added. There are couple of ways to implement static type checking like; flow from facebook, PropTypes and Typescript. Typescript is well integrated with Visual Studio Code and supports better linter, error messages, and intellisense. Reference site Github Sample Ex4 Currnet version D:\GitRepo\reactnative>npm --version 6.3.0 D:\GitRepo\reactnative>react-native --version react-native-cli: 2.0.1 react-native: n/a - not inside a React Native project directory D:\GitRepo\reactnative>yarn --version 1.9.4 Creating React Native App $ react-native init ex4 If you want to specify the version, add "--version 0.57.3" at the end. Add NativeBase to React Native $ npm install native-base --save ... + native-base@2.8.1 added 71 packages from 42 contributors, removed 50 packages, updated 829 packages and audited 34989 packages in 138.542s found 0 vulnerabilities $ $ yarn yarn install v1.9.4 warning package-lock.json found. You

Installing Icinga, graylog, Cacti on Ubuntu 14.04

Installing Icinga, graylog, Cacti on Ubuntu 14.04

As part of monitoring project in our company, we’ve reviewed multiple options, but we decided to use Icinga for general monitoring, cacti for network trend monitoring, and graylog for logging solution

I’ve looked at DB option and I choosed the MySql because of Cacti.

1. Installing Icinga2 and Icingaweb2

I am one of big fan on Icinga because of their decent UI and flexibility as nagios

Icinga will have three databases after installation,

  • Icinga: This will be created manually by using mysql import
  • Icingaweb: Automatically created from web installation
  • Icingaido: Automatically create from web installation

Installing Icinga

sudo add-apt-repository ppa:formorer/icinga
sudo apt-get install icinga2
sudo apt-get install mysql-server mysql-client
During installation, it will ask MySQL admin password.

Creating database for icinga
mysql -u root -p
CREATE DATABASE icinga;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO ‘icinga’@’localhost’ IDENTIFIED BY ‘icinga’;

mysql> CREATE DATABASE icinga;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO ‘icinga’@’localhost’ IDENTIFIED BY ‘icinga’;
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| icinga |
| mysql |
| performance_schema |
+——————–+
4 rows in set (0.00 sec)
mysql>

Install icinga2 IDO mysql

sudo apt-get install icinga2-ido-mysql
Answer question for “Configure database for icinga-idoutils with dbconfig-common?” I choose “Yes”
Enter mysql pasword
Enter password for icinga2-ido-mysql

Enable features of icinga

sudo icinga2 feature enable gelf
sudo icinga2 feature enable ido-mysql
sudo icinga2 feature enable command
sudo icinga2 feature enable perfdata
sudo service icinga2 restart

Installing Icinga IDOUtils

sudo apt-get install icinga-idoutils
Choose mail option properly

Installing Icinga-web

sudo wget -O - http://packages.icinga.org/icinga.key | sudo apt-key add -
sudo add-apt-repository ‘deb http://packages.icinga.org/ubuntu icinga-trusty main’
sudo apt-get update
sudo apt-get install icingaweb2
sudo icingacli setup token create

alex@monitoring:/etc/dbconfig-common$ sudo icingacli setup token create
The newly generated setup token is: 87c1e41c17c8de0a

sudo apt-get install php5-json php5-gd php5-imagick php5-mysql php5-intl


  • Enter Setup Token which created from “sudo icingacli setup token create”
  • I checked both options, Doc and Monitoring, from Modules
  • After that, couple of things will be complain such as date.timezone from PHP config
    sudo vi /etc/php5/apache2/php.ini and enter timezone information
  • Restart apache
    sudo service apache2 restart

  • Authentication
    database

  • User preference storage type
    database
  • Database Resource

Resource Name: icingaweb_db
Database type: Mysql
Host: localhost
Port: 3306
Database Name: icingaweb
username: icinga
Password: * (This password should be “icinga” if you use default password)

  • Athentication Backend
    Icingaweb2

  • Administration

    username: admin
    password: **
    repeat password: **

  • Application Configuration

    Logging Type: syslog
    Logging level: Error
    Application prefix: icingaweb2

  • Database setup
    Username: root
    Password: **
  • Confirmation screen. Check all information and click next

  • Welcome to the configuration of the monitoring module for Icinga Web 2!

  • Monitoring backend
    Backend name: icinga
    Backend type: IDO
  • Monitoring IDO Resource

    Resource name: icinga_ido
    Database Type : Mysql
    Host: localhost
    Port: 3306
    If database information is not sure, check “sudo cat /etc/icinga/ido2db.cfg” and database list and username
    Database name: icinga2idomysql
    Username: icinga2-ido-mysq
    Password: **

  • Monitoring Instance
    Instance name: Icinga
    Instance Type: Local Command File
    Command File: /var/run/icinga2/cmd/icinga2.cmd
  • Monitoring Security
    Protected Custom Variables:pw,pass,community
    -Check all information and click finish
  • Finally, if you enter all information correctly, the icinga web page will be shown and enter username and password which you created during installation steps.

    2. Installing Cacti

    sudo apt-get install cacti-spine

    If you have messages, “libphp-adodb is no longer installed in /usr/share/adodb. New installation path is now /usr/share/php/adodb ….”, check the php.ini file and update the path correctly. In my case, I don’t have any setting in the php.ini.

    Enter Mysql admin password
    Enter MySQL application password for cacti
    Web Server: apache2

    Check the database credential from /etc/cacti/cacti-spine.conf
    Creating database
    mysqladmin –user root –p create cacti
    If you have error message regarding access denied from root@localhost, run following command from mysql.
    mysql -u root -p
    mysql> grant all privileges on . to ‘root’@’localhost’;

    Importing schema
    mysql –u root –p cacti < /usr/share/doc/cacti/cacti.sql
    To find out the file location, use
    find /usr –name cacti.sql

    To access site,
    http://localhost/cacti

    There will be installation screen

    Select New Install
    Leave all field as default from cacti installation guide
    Click Finish

    You will see the login screen and enter “admin” and “admin” for password and it will guide you to change the password screen.

    3. Installing Graylog2 and web interface

    Installing Java

    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer

    Installing MongoDB

    sudo apt-get install mongodb

    To install latest version (option)
    sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 7F0CEB10
    echo ‘deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen’ | sudo tee /etc/apt/sources.list.d/mongodb.list
    sudo apt-get update
    sudo apt-get install mongodb-org

    Installing Elasticsearch

    sudo wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.7.2.deb
    sudo dpkg -i elasticsearch-1.7.2.deb

    set cluster.name value to “graylog2” and disable dynamic scripts
    sudo vi /etc/elasticsearch/elasticsearch.yml
    cluster.name: graylog2
    Add following line at the end of lines
    script.disable_dynamic: true

    sudo service elasticsearch restart

    Updating elasticsearch to default deamon
    sudo update-rc.d elasticsearch defaults

    Checking elastic search
    alex@monitoring:~$ curl -X GET http://localhost:9200
    {
    “status” : 200,
    “name” : “Caleb Alexander”,
    “cluster_name” : “graylog2”,
    “version” : {
    “number” : “1.7.2”,
    “build_hash” : “e43676b1385b8125d647f593f7202acbd816e8ec”,
    “build_timestamp” : “2015-09-14T09:49:53Z”,
    “build_snapshot” : false,
    “lucene_version” : “4.10.4”
    },
    “tagline” : “You Know, for Search”
    }
    alex@monitoring:~$

    Installing graylog

    sudo apt-get install pwgen
    sudo wget https://packages.graylog2.org/repo/packages/graylog-1.2-repository-ubuntu14.04_latest.deb

    • This will add graylog source repository
      sudo dpkg -i graylog-1.2-repository-ubuntu14.04_latest.deb
      sudo apt-get update
      sudo apt-get install apt-transport-https
      sudo apt-get install graylog-server graylog-web
      SECRET=SECRET’/’ /etc/graylog/server/server.conf

    PASSWORD=PASSWORD’/’ /etc/graylog/web/web.conf
    sudo vi /etc/graylog/web/web.conf
    SECRET=SECRET’”/’ /etc/graylog/server/server.conf

    update graylog2-server.uris link from /etc/graylog/web/web.conf
    graylog2-server.uris = “http://localhost:12900

    sudo stop graylog-server
    sudo start graylog-server
    sudo stop graylog-web
    sudo start graylog-web

    To access the graylog, go to “http://localhost:9000” and enter “admin” for username and “password” for password which you defined from “PASSWORD=1}’)”

    Written with StackEdit.

    Comments

    Popular posts from this blog

    Export folder structure to file on Windows, Mac, and Linux

    Adding SOAP Header generated by JAXB(wsimport)

    Sample application for Active Directory SSO with Spring Security 4 and Waffle