Quantcast
Channel: Teguh Triharto Learning Center
Viewing all 413 articles
Browse latest View live

.::: Install MariaDB 10.1 On Centos/Rhel Using Yum Repository :::.

$
0
0
MariaDB Server is one of the most popular database servers in the world. It’s made by the original developers of MySQL and guaranteed to stay open source. Notable users include Wikipedia, WordPress.com and Google.

MariaDB turns data into structured information in a wide array of applications, ranging from banking to websites. It is an enhanced, drop-in replacement for MySQL. MariaDB is used because it is fast, scalable and robust, with a rich ecosystem of storage engines, plugins and many other tools make it very versatile for a wide variety of use cases.

MariaDB is developed as open source software and as a relational database it provides an SQL interface for accessing data. The latest versions of MariaDB also include GIS and JSON features.

1. Add MariaDB Yum Repository
Start by adding the MariaDB YUM repository file MariaDB.repo for RHEL/CentOS and Fedora systems.
# vi /etc/yum.repos.d/MariaDB.repo

Now add the following lines to your respective Linux distribution version as shown.

On CentOS 7

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

On RHEL 7

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/rhel7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

[root@TeguhLab data]# cat /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

[root@TeguhLab data]#

2. Install MariaDB in CentOS 7
# yum -y install MariaDB-server MariaDB-client

3. Start Mariadb & enable automatic start

# systemctl start mariadb
# systemctl enable mariadb
# systemctl status mariadb

[root@TeguhLab data]# systemctl enable mariadb
[root@TeguhLab data]# systemctl start mariadb
[root@TeguhLab data]# systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Thu 2017-10-12 15:05:13 WIB; 6s ago
  Process: 3524 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 3473 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 3459 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 3493 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           └─3493 /usr/sbin/mysqld

Oct 12 15:05:13 TeguhLab mysqld[3493]: 2017-10-12 15:05:13 139706611513536 [Note] InnoDB: Highest supported file for...acuda.
Oct 12 15:05:13 TeguhLab mysqld[3493]: 2017-10-12 15:05:13 139706611513536 [Note] InnoDB: 128 rollback segment(s) are active.
Oct 12 15:05:13 TeguhLab mysqld[3493]: 2017-10-12 15:05:13 139706611513536 [Note] InnoDB: Waiting for purge to start
Oct 12 15:05:13 TeguhLab mysqld[3493]: 2017-10-12 15:05:13 139706611513536 [Note] InnoDB:  Percona XtraDB (http://ww...616717
Oct 12 15:05:13 TeguhLab mysqld[3493]: 2017-10-12 15:05:13 139706611513536 [Note] Plugin 'FEEDBACK' is disabled.
Oct 12 15:05:13 TeguhLab mysqld[3493]: 2017-10-12 15:05:13 139705827981056 [Note] InnoDB: Dumping buffer pool(s) not...tarted
Oct 12 15:05:13 TeguhLab mysqld[3493]: 2017-10-12 15:05:13 139706611513536 [Note] Server socket created on IP: '::'.
Oct 12 15:05:13 TeguhLab mysqld[3493]: 2017-10-12 15:05:13 139706611513536 [Note] /usr/sbin/mysqld: ready for connections.
Oct 12 15:05:13 TeguhLab mysqld[3493]: Version: '10.1.28-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  ...Server
Oct 12 15:05:13 TeguhLab systemd[1]: Started MariaDB database server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@TeguhLab data]#

4. Setting password root & Secure MariaDB
# mysqladmin -u root password 'root'
# mysql_secure_installation

[root@TeguhLab data]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@TeguhLab data]#

5. Check certain MariaDB features
# mysql -V
# mysqld ---print-defaults
# mysql -u root -p


[root@TeguhLab data]# mysql -V
mysql  Ver 15.1 Distrib 10.1.28-MariaDB, for Linux (x86_64) using readline 5.1
[root@TeguhLab data]# mysqld ---print-defaults
2017-10-12 15:07:31 139664944203968 [Note] mysqld (mysqld 10.1.28-MariaDB) starting as process 3602 ...
mysqld: Please consult the Knowledge Base to find out how to run mysqld as root!
2017-10-12 15:07:31 139664944203968 [ERROR] Aborting

[root@TeguhLab data]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.1.28-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>

6. Create Database & user
create user 'cactiuser' identified by 'cactipwd';
create database cacti;
grant all privileges on cacti.* to 'cactiuser'@'%' identified by 'cactipwd' with grant option;
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
FLUSH PRIVILEGES;

create user 'cactiuser' identified by 'cactipwd';
create database cacti;
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipwd';
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
FLUSH PRIVILEGES;

[root@TeguhLab data]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.1.28-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>
MariaDB [(none)]> create user 'cactiuser' identified by 'cactipwd';
user 'cactiuser' identified by 'cactipwd';
create database cacti;
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipwd';
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> create database cacti;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on cacti.* to 'cactiuser'@'%' identified by 'cactipwd' with grant option;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
ERROR 1133 (28000): Can't find any matching row in the user table
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>
MariaDB [(none)]> create user 'cactiuser' identified by 'cactipwd';
ERROR 1396 (HY000): Operation CREATE USER failed for 'cactiuser'@'%'
MariaDB [(none)]> create database cacti;
ERROR 1007 (HY000): Can't create database 'cacti'; database exists
MariaDB [(none)]> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipwd';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

MariaDB [(none)]>

7. Tunning my.cnf/server.cnf & client
# cat /etc/my.cnf.d/client.cnf

[root@TeguhLab data]# cat /etc/my.cnf.d/client.cnf
#
# These two groups are read by the client library
# Use it for options that affect all clients, but not the server
#

[client]
default-character-set=utf8
# This group is not read by mysql client library,
# If you use the same .cnf file for MySQL and MariaDB,
# use it for MariaDB-only client options
[client-mariadb]

[root@TeguhLab data]#
[root@TeguhLab data]# cat /etc/my.cnf.d/server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]

collation-server = utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
max_heap_table_size = 256M
max_allowed_packet = 16777216
tmp_table_size = 64M
join_buffer_size = 64M
innodb_file_per_table = on
innodb_doublewrite = off
innodb_additional_mem_pool_size = 80M
innodb_flush_log_at_trx_commit = 2

#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

# This group is only read by MariaDB-10.1 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.1]

[root@TeguhLab data]# systemctl restart mariadb
[root@TeguhLab data]#

.::: Install Cacti 1.0.x on Centos 7/Rhel 7 Using MariaDB :::.

$
0
0
Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG.

UPDATE:
Since new release is out, I added the procedures for upgrading cacti 1.0.1 to 1.0.x; and from 1.0.x to 1.1.x
1. Disable SELinux
[root@TeguhLab data]# cat /etc/selinux/config | grep SELINUX
# SELINUX= can take one of these three values:
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
SELINUXTYPE=targeted
[root@TeguhLab data]#

2. Disable Firewall
[root@TeguhLab data]# systemctl disable firewalld.service
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@TeguhLab data]# systemctl stop firewalld.service
[root@TeguhLab data]# systemctl status firewalld.service
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled)
   Active: inactive (dead)

Oct 12 14:34:50 TeguhLab systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 12 14:34:54 TeguhLab systemd[1]: Started firewalld - dynamic firewall daemon.
Oct 12 14:33:05 TeguhLab systemd[1]: Stopping firewalld - dynamic firewall daemon...
Oct 12 14:33:06 TeguhLab systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@TeguhLab data]#

3. Configure hosts
[root@TeguhLab data]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.10 TeguhLab
[root@TeguhLab data]#

4. Install Package patch & wget
# yum -y install wget mlocate

5. Install package cacti & snmp
# yum -y install net-snmp netsnmp-devel net-snmp-utils mariadb mariadb-devel gcc help2man rrdtools php php-snmp php-process php-mysql php-pdo php-ldap php-mbstring php-xml git rrdtool

6. Configure date.timezone on php
[root@TeguhLab data]# cat /etc/php.ini | grep date.time
; http://php.net/date.timezone
;date.timezone =Asia/Jakarta
[root@TeguhLab data]#

7. Download the sources, change
# wget http://www.cacti.net/downloads/cacti-1.0.1.tar.gz

[root@TeguhLab data]# wget http://www.cacti.net/downloads/cacti-1.0.1.tar.gz
--2017-10-12 16:02:20--  http://www.cacti.net/downloads/cacti-1.0.1.tar.gz
Resolving www.cacti.net (www.cacti.net)... 104.28.9.127, 104.28.8.127, 2400:cb00:2048:1::681c:87f, ...
Connecting to www.cacti.net (www.cacti.net)|104.28.9.127|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.cacti.net/downloads/cacti-1.0.1.tar.gz [following]
--2017-10-12 16:02:20--  https://www.cacti.net/downloads/cacti-1.0.1.tar.gz
Connecting to www.cacti.net (www.cacti.net)|104.28.9.127|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7230227 (6.9M) [application/x-gzip]
Saving to: ‘cacti-1.0.1.tar.gz’

100%[===================================================================================>] 7,230,227    253KB/s   in 18s   

2017-10-12 16:02:40 (390 KB/s) - ‘cacti-1.0.1.tar.gz’ saved [7230227/7230227]

[root@TeguhLab data]# ls
cacti-1.0.1.tar.gz
[root@TeguhLab data]# cp cacti-1.0.1.tar.gz /var/www/
[root@TeguhLab data]# cd /var/www/
[root@TeguhLab www]# ls
cacti-1.0.1.tar.gz  cgi-bin  html
[root@TeguhLab www]# tar -xvf cacti-1.0.1.tar.gz
[root@TeguhLab www]# ls
cacti-1.0.1  cacti-1.0.1.tar.gz  cgi-bin  html
[root@TeguhLab www]# mv cacti-1.0.1 cacti
[root@TeguhLab www]# ls
cacti  cacti-1.0.1.tar.gz  cgi-bin  html
[root@TeguhLab www]#


8. Change permission folder cacti
# chown -R apache:apache /var/www/cacti

[root@TeguhLab data]# chown -R apache:apache /var/www/cacti
[root@TeguhLab data]#

9. Install Database & configuration database
http://teguhth.blogspot.co.id/2017/10/install-mariadb-101-on-centosrhel-using.html
create user 'cactiuser' identified by 'cactipwd';
create database cacti;
grant all privileges on cacti.* to 'cactiuser'@'%' identified by 'cactipwd' with grant option;
FLUSH PRIVILEGES;

create user 'cactiuser' identified by 'cactipwd';
create database cacti;
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipwd';
FLUSH PRIVILEGES;

10. Configuration mysql_tzinfo_to_sql  /usr/share/zoneinfo | mysql -p mysql
# mysql_tzinfo_to_sql  /usr/share/zoneinfo | mysql -p mysql

[root@TeguhLab ~]# mysql_tzinfo_to_sql  /usr/share/zoneinfo | mysql -p mysql
Enter password:
[root@TeguhLab ~]#

11. Konfigurasi snmpd
# systemctl enable snmpd.service
# systemctl start snmpd.service
# systemctl status snmpd.service

[root@TeguhLab www]# systemctl enable snmpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/snmpd.service to /usr/lib/systemd/system/snmpd.service.
[root@TeguhLab www]# systemctl start snmpd.service
[root@TeguhLab www]# systemctl status snmpd.service
● snmpd.service - Simple Network Management Protocol (SNMP) Daemon.
   Loaded: loaded (/usr/lib/systemd/system/snmpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2017-10-12 16:07:33 WIB; 11s ago
 Main PID: 1603 (snmpd)
   CGroup: /system.slice/snmpd.service
           └─1603 /usr/sbin/snmpd -LS0-6d -f

Oct 12 16:07:33 TeguhLab systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
Oct 12 16:07:33 TeguhLab snmpd[1603]: NET-SNMP version 5.7.2
Oct 12 16:07:33 TeguhLab systemd[1]: Started Simple Network Management Protocol (SNMP) Daemon..
[root@TeguhLab www]#

12. Konfigurasi database Cacti
[root@TeguhLab www]# mysql -u cactiuser -p cacti < /var/www/cacti/cacti.sql
Enter password:
[root@TeguhLab www]#

13. Konfigurasi Cacti
# cat /var/www/cacti/include/config.php | grep database

[root@TeguhLab www]# cat /var/www/cacti/include/config.php | grep database
/* make sure these values reflect your actual database/host/user/password */
$database_type     = 'mysql';
$database_default  = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cactiuser';
$database_password = 'cactipwd';
$database_port     = '3306';
$database_ssl      = false;
#$rdatabase_type     = 'mysql';
#$rdatabase_default  = 'cacti';
#$rdatabase_hostname = 'localhost';
#$rdatabase_username = 'cactiuser';
#$rdatabase_password = 'cactiuser';
#$rdatabase_port     = '3306';
#$rdatabase_ssl      = false;
/* save sessions to a database for load balancing */
[root@TeguhLab www]#

14. Konfigurasi httpd
# cat /etc/httpd/conf.d/cacti.conf
# cat /etc/httpd/conf/httpd.conf | grep ServerName

[root@TeguhLab www]#  cat /etc/httpd/conf.d/cacti.conf
Alias /cacti/ /var/www/cacti/
<Directory /var/www/cacti/>
    DirectoryIndex index.php
    Options -Indexes
    AllowOverride all
    order deny,allow
    deny from all
    allow from all
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc on
    php_flag track_vars on
</Directory>
[root@TeguhLab www]#
[root@TeguhLab www]# cat /etc/httpd/conf/httpd.conf | grep ServerName
# ServerName gives the name and port that the server uses to identify itself.
#ServerName www.example.com:80
ServerName 127.0.0.1:80
[root@TeguhLab www]#

15. Konfigurasi cronjob untuk Cacti
[root@TeguhLab www]# cat /etc/cron.d/cacti
#*/5 * * * *    cacti    php /var/www/cacti/poller.php &>/dev/null
*/5 * * * * cacti /usr/bin/php /var/www/cacti/poller.php > /dev/null 2>&1
[root@TeguhLab www]#

16. Start httpd
# systemctl enable httpd.service 
# systemctl restart httpd.service  
# systemctl status httpd.service

[root@TeguhLab www]# systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@TeguhLab www]# systemctl restart httpd.service
[root@TeguhLab www]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2017-10-12 16:16:14 WIB; 6s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 1964 (httpd)
   Status: "Processing requests..."
   CGroup: /system.slice/httpd.service
           ├─1964 /usr/sbin/httpd -DFOREGROUND
           ├─1986 /usr/sbin/httpd -DFOREGROUND
           ├─1987 /usr/sbin/httpd -DFOREGROUND
           ├─1988 /usr/sbin/httpd -DFOREGROUND
           ├─1989 /usr/sbin/httpd -DFOREGROUND
           └─1990 /usr/sbin/httpd -DFOREGROUND

Oct 12 16:16:14 TeguhLab systemd[1]: Starting The Apache HTTP Server...
Oct 12 16:16:14 TeguhLab systemd[1]: Started The Apache HTTP Server.
[root@TeguhLab www]#

17. Running cacti.
Open browser and type using url
http://IP_cacti/cacti/
example
http://10.10.10.10/cacti/

if you fresh install or upgrade. firts run as below then next next, choose fresh install or upgrade
http://IP_cacti/cacti/install/
example
http://10.10.10.10/cacti/install/

tutotial http://logch.blogspot.co.id/2017/02/install-cacti-spine-in-centos-7-with.html?m=1

.::: Enable CPU Temperature Information on Linux (Rhel6/Centos6),(Rhel7/Centos7) Using lm_sensors :::.

$
0
0
lm_sensors (Linux monitoring sensors) is a free and open-source application that provides tools and drivers for monitoring temperatures, voltage, and fans. This document explains how to install, configure, and use lm_sensors.

A. Enable Temperature using lm_sensors

1. Download rpm lm_sensors if you using offline
For Rhel6/Centos6 Download rpm lm_sensors-3.1.1-17.el6.x86_64.rpm then copy to server
# wget  http://mirror.centos.org/centos/6/os/x86_64/Packages/lm_sensors-3.1.1-17.el6.x86_64.rpm

For Rhel7/Centos7 Download lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm, lm_sensors-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm
# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm
# wget https://www.rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/lm_sensors-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm

2. Installation
Offline Installation
Install patch for Rhel6.x/Centos6
# rpm -ivh lm_sensors-3.1.1-17.el6.x86_64.rpm

Install patch for Rhel7/Centos7
# rpm -qa | grep -i 'lm_sensors'
lm_sensors-libs-3.3.4-11.el7.x86_64
#
# rpm --nodeps -e lm_sensors-libs-3.3.4-11.el7.x86_64
# rpm -ivh lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm lm_sensors-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm

Online Installation
# yum -y lm_sensors

or

# apt-get lm-sensors

3. Configuration
# sensors-detect
Do you want to scan for them? This is totally safe. (YES/no): YES
Do you want to scan for Super I/O sensors? (YES/no): YES
Do you want to scan for IPMI interfaces? (YES/no): YES
ISA slots! Do you want to scan the ISA I/O ports? (YES/no): YES
Do you want to probe the I2C/SMBus adapters now? (YES/no): YES
Do you want to scan it? (YES/no/selectively): YES
Just press ENTER to continue:
Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): YES

4. get the temperature information
# sensors
power_meter-acpi-0
Adapter: ACPI interface
power1:       0.00 nW  (interval = 300.00 s)

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0: +40.0°C  (high = +90.0°C, crit = +100.0°C) 
Core 0:        +34.0°C  (high = +90.0°C, crit = +100.0°C) 
Core 1:        +32.0°C  (high = +90.0°C, crit = +100.0°C) 
Core 2:        +34.0°C  (high = +90.0°C, crit = +100.0°C) 
Core 3:        +35.0°C  (high = +90.0°C, crit = +100.0°C) 

coretemp-isa-0004
Adapter: ISA adapter
Physical id 1: +43.0°C  (high = +90.0°C, crit = +100.0°C) 
Core 0:        +36.0°C  (high = +90.0°C, crit = +100.0°C) 
Core 1:        +36.0°C  (high = +90.0°C, crit = +100.0°C) 
Core 2:        +37.0°C  (high = +90.0°C, crit = +100.0°C) 
Core 3:        +34.0°C  (high = +90.0°C, crit = +100.0°C) 

#

5. Create script temperature.sh for resume for example
#!/bin/bash
data=$(sensors | grep 'Core 0:' | awk '{print $3}' | cut -c2-3)
echo "0:"$data":OK!"

sample
[root@labs]# more temperature.sh
#!/bin/bash
data=$(sensors | grep 'Core 0:' | awk '{print $3}' | cut -c2-3)
echo "0:"$data":OK!"
[root@labs]#

[root@labs]# ./temperature.sh
0:39 43:OK!
[root@labs]#

B. Monitor to NMS
1. Create user SSH Create User access SSH on Linux (user: teguht  , password: teguhthebat)
# useradd teguht
# passwd teguht

Sample log
[root@Lab ~]# useradd teguht
[root@Lab ~]# passwd teguht
Changing password for user teguht.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@Lab ~]#

2. Monitoring to NMS example PRTG
Create directory /var/prtg/scripts every device
# cd /var
# mkdir prtg
# cd prtg
# mkdir scripts
# cd scripts

Create script temperature.sh on directory /var/prtg/scripts
# cd /var/prtg/scripts
#!/bin/bash
data=$(sensors | grep 'Core 0:' | awk '{print $3}' | cut -c2-3)
echo "0:"$data":OK!"
#

sample
[root@labs]# more temperature.sh
#!/bin/bash
data=$(sensors | grep 'Core 0:' | awk '{print $3}' | cut -c2-3)
echo "0:"$data":OK!"
[root@labs]#

[root@labs]# ./temperature.sh
0:39 43:OK!
[root@labs]#

3. Make it executable
# chmod +x temperature.sh
# modprobe coretemp

4. Add sensor/measurement to device
Go to prtg, fill to below and save
Add Sensor = SSH Script
Choose script = temperature.sh
Unit String = Celsius
User Credential : teguht
Password = teguhthebat

5. if you want to remove
# yum -y remove lm_sensors

Tutorial 

.::: How Settting & Install Package OS Centos 7 Using Repolocal, ISO File :::.

$
0
0

1. Make sure Iso file copying on Disk
[root@TeguhLab7 data]# ls
CentOS-7-x86_64-DVD-1708.iso                 lm_sensors-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm       net-snmp-perl-5.7.2-28.el7.x86_64.rpm  repolocal
compat-libstdc++-33-3.2.3-72.el7.i686.rpm    lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm  psensor-1.1.3                          snmpd
compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm  lm sensor.txt                                              psensor-1.1.3.tar.gz
[root@TeguhLab7 data]#

2. mounting to /mnt
[root@TeguhLab7 data]# mount -o loop CentOS-7-x86_64-DVD-1708.iso /mnt/

3. checking mounting mnt
[root@TeguhLab7 data]# df -kh
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   27G   12G   15G  44% /
devtmpfs                 4.8G     0  4.8G   0% /dev
tmpfs                    4.9G  8.0K  4.9G   1% /dev/shm
tmpfs                    4.9G  8.9M  4.8G   1% /run
tmpfs                    4.9G     0  4.9G   0% /sys/fs/cgroup
/dev/sda1                497M  124M  373M  25% /boot
tmpfs                    985M   32K  984M   1% /run/user/0
/dev/sr0                 4.1G  4.1G     0 100% /cdrom
/dev/loop0               4.3G  4.3G     0 100% /mnt
[root@TeguhLab7 data]#

4. Backup Centos repo
[root@Centos7 data]# cd /etc/yum.repos.d/
[root@Centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo  epel.repo  epel-testing.repo
[root@Centos7 yum.repos.d]# mkdir tmp
[root@Centos7 yum.repos.d]# mv Cen* tmp/
[root@Centos7 yum.repos.d]# ls
tmp
[root@Centos7 yum.repos.d]# cd tmp/
[root@Centos7 tmp]# ls
CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo  epel.repo  epel-testing.repo
[root@Centos7 tmp]# cp CentOS-Base.repo /etc/yum.repos.d/
[root@Centos7 tmp]# cd ../
[root@Centos7 yum.repos.d]# ls
CentOS-Base.repo  tmp
[root@Centos7 yum.repos.d]#

5. Setting Repolocal using iso and save
additional baseurl=file:///mnt
[root@TeguhLab7 data]# more /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
#baseurl=file:///run/media/root/"CentOS 7 x86_64"/
baseurl=file:///mnt
gpgcheck=0
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[root@TeguhLab7 data]#

6. Testing install package using DVD or Iso file
# yum install nmap
# yum install net-snmp net-snmp-libs net-snmp-utils net-snmp-perl net-snmp-python
# rpm -q net-snmp net-snmp-libs net-snmp-utils net-snmp-perl net-snmp-python
  
[root@TeguhLab7 yum.repos.d]# yum -y install nmap
Loaded plugins: fastestmirror, langpacks
base                                                                                                  | 3.6 kB  00:00:00    
extras                                                                                                | 3.4 kB  00:00:00    
updates                                                                                               | 3.4 kB  00:00:00    
(1/3): base/group_gz                                                                                  | 156 kB  00:00:00    
(2/3): base/primary_db                                                                                | 3.1 MB  00:00:00    
(3/3): extras/7/x86_64/primary_db                                                                     | 145 kB  00:00:00    
Loading mirror speeds from cached hostfile
 * extras: centos.biz.net.id
 * updates: centos.biz.net.id
Resolving Dependencies
--> Running transaction check
---> Package nmap.x86_64 2:6.40-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                    Arch                         Version                            Repository                  Size
=============================================================================================================================
Installing:
 nmap                       x86_64                       2:6.40-7.el7                       base                       4.0 M

Transaction Summary
=============================================================================================================================
Install  1 Package

Total download size: 4.0 M
Installed size: 16 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:nmap-6.40-7.el7.x86_64                                                                                  1/1
  Verifying  : 2:nmap-6.40-7.el7.x86_64                                                                                  1/1

Installed:
  nmap.x86_64 2:6.40-7.el7                                                                                                  

Complete!

.::: How to Create Tablespace & Check Capacity, Add datafile On existing tablespace, Change Autoextend :::.

$
0
0
A tablespace is a container for segments (tables, indexes, etc). A database consists of one or more tablespaces, each made up of one or more data files. Tables and indexes are created within a particular tablespace. Oracle has a limit of 64,000 data files per database.

1. Create new tablespace, create user, grant previledge
[oracle@TeguhLabOracle ~]$ more Teguhdatatgh.sql
CREATE TABLESPACE Teguhdata DATAFILE '$ORACLE_BASE/oradata/tgh/Teguhdata.dbf' size 100M AUTOEXTEND ON;

CREATE USER Teguhdata IDENTIFIED BY Teguhdata DEFAULT TABLESPACE Teguhdata TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON Teguhdata;

GRANT CONNECT,RESOURCE, CREATE ANY VIEW TO Teguhdata;

GRANT CREATE JOB TO Teguhdata;

[oracle@TeguhLabOracle ~]$ sqlplus sys/oracle@tgh as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 11 14:15:52 2018

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @Teguhdatatgh.sql

Tablespace created.

User created.

Grant succeeded.

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@TeguhLabOracle ~]$

2. Check table space
SELECT TABLESPACE_NAME, FILE_NAME, BYTES FROM DBA_DATA_FILES;
select tablespace_name, file_name, bytes ,maxbytes, status, autoextensible, increment_by, online_status from DBA_DATA_FILES;
select tablespace_name, file_name, bytes/1024/1024/1024 Size_GB, maxbytes/1024/1024/1024 Maxsize_GB, status, autoextensible, increment_by, online_status from DBA_DATA_FILES;

3. Additional datafile on existing tablespace
alter TABLESPACE  Teguhdata add DATAFILE '/u01/app/oracle/oradata/tgh/Teguhdata01.dbf' SIZE 100M ;
alter TABLESPACE  Teguhdata add DATAFILE '/u01/app/oracle/oradata/tgh/Teguhdata02.dbf' SIZE 100M ;
alter TABLESPACE  Teguhdata add DATAFILE '/u01/app/oracle/oradata/tgh/Teguhdata03.dbf' SIZE 100M AUTOEXTEND ON ;

4. Show Max Capacity
SELECT TABLESPACE_NAME, FILE_NAME, BYTES FROM DBA_DATA_FILES;
select tablespace_name, file_name, bytes ,maxbytes, status, autoextensible, increment_by, online_status from DBA_DATA_FILES;
select tablespace_name, file_name, bytes/1024/1024/1024 Size_GB, maxbytes/1024/1024/1024 Maxsize_GB, status, autoextensible, increment_by, online_status from DBA_DATA_FILES;

5. Change datafile to autoextend, Show Max Capacity
alter database DATAFILE '/u01/app/oracle/oradata/tgh/Teguhdata02.dbf'  AUTOEXTEND ON ;


6. Show allocation and free space big data
col tablespace_name format a16;
col file_name format a36;
SELECT a.tablespace_name, a.file_name, a.bytes allocated_bytes,  b.free_bytes  FROM dba_data_files a,  (SELECT file_id, SUM(bytes) free_bytes FROM dba_free_space b GROUP BY file_id) b WHERE a.file_id=b.file_id ORDER BY a.tablespace_name;

7. Show percentage Teguhdata
select df.tablespace_name "Tablespace",totalusedspace "Used MB", round(((totalusedspace* 100)/df.totalspace)) pct_used,
(CASE WHEN round(((totalusedspace* 100)/df.totalspace)) > 90 THEN 'FAILED' ELSE 'SUCCEED' END) STATUS
from (select tablespace_name, round(sum(bytes) / 1048576) TotalSpace from dba_data_files group by tablespace_name) df,
(select round(sum(bytes)/(1024*1024)) totalusedspace, tablespace_name from dba_segments group by tablespace_name) tu
where df.tablespace_name = tu.tablespace_name and df.tablespace_name = 'Teguhdata';
 

.::: Monitoring OID/MIB Temperature, Fan Speed on PaloAlto Firewall:::.

$
0
0

Palo Alto Networks, Inc. is a network and enterprise security company based in Santa Clara, California. The company’s core products are a platform that includes advanced firewalls designed to provide network security, visibility, and granular control of network activity based on application, user, and content identification and cloud-based offerings that extend those firewalls to cover other aspects of security. In 2017, Palo Alto Networks announced the availability of its new cloud-based service Logging Services, allowing customers to amass their own data. Must enable ENTITY-SENSOR-MIB.mib

1. Info Hardware Temperature & Fan

info OID Hardware : 1.3.6.1.2.1.47.1.1.1.1.7

[root@TeguhLab ~]# snmpwalk -v2c -c  teguht 10.10.10.10 1.3.6.1.2.1.47.1.1.1.1.7
SNMPv2-SMI::mib-2.47.1.1.1.1.7.1 = STRING: "PA-3020"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.2 = STRING: "Fan #1 RPM"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.3 = STRING: "Fan #2 RPM"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.4 = STRING: "Fan #3 RPM"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.5 = STRING: "Fan #4 RPM"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.6 = STRING: "Temperature @ Ocelot"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.7 = STRING: "Temperature @ Switch"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.8 = STRING: "Temperature @ Cavium"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.9 = STRING: "Temperature @ Intel PHY"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.10 = STRING: "Temperature @ Switch Core"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.11 = STRING: "Temperature @ Cavium Core"
[root@TeguhLab ~]#


Resume Info Hardware Temperature & Fan
1.3.6.1.2.1.47.1.1.1.1.7.2 Fan #1 RPM
1.3.6.1.2.1.47.1.1.1.1.7.3 Fan #2 RPM
1.3.6.1.2.1.47.1.1.1.1.7.4 Fan #3 RPM
1.3.6.1.2.1.47.1.1.1.1.7.5 Fan #4 RPM
1.3.6.1.2.1.47.1.1.1.1.7.6 Temperature @ Ocelot
1.3.6.1.2.1.47.1.1.1.1.7.7 Temperature @ Switch
1.3.6.1.2.1.47.1.1.1.1.7.8 Temperature @ Cavium
1.3.6.1.2.1.47.1.1.1.1.7.9 Temperature @ Intel PHY
1.3.6.1.2.1.47.1.1.1.1.7.10 Temperature @ Switch Core
1.3.6.1.2.1.47.1.1.1.1.7.11 Temperature @ Cavium Core

2. Info Output for temperature & Fan Speed
info OID Output : 1.3.6.1.2.1.99.1.1.1.4

[root@TeguhLab ~]# snmpwalk -v2c -c teguht 10.10.10.10  1.3.6.1.2.1.99.1.1.1.4
SNMPv2-SMI::mib-2.99.1.1.1.4.2 = INTEGER: 14310
SNMPv2-SMI::mib-2.99.1.1.1.4.3 = INTEGER: 14781
SNMPv2-SMI::mib-2.99.1.1.1.4.4 = INTEGER: 14362
SNMPv2-SMI::mib-2.99.1.1.1.4.5 = INTEGER: 14838
SNMPv2-SMI::mib-2.99.1.1.1.4.6 = INTEGER: 29
SNMPv2-SMI::mib-2.99.1.1.1.4.7 = INTEGER: 34
SNMPv2-SMI::mib-2.99.1.1.1.4.8 = INTEGER: 34
SNMPv2-SMI::mib-2.99.1.1.1.4.9 = INTEGER: 24
SNMPv2-SMI::mib-2.99.1.1.1.4.10 = INTEGER: 52
SNMPv2-SMI::mib-2.99.1.1.1.4.11 = INTEGER: 45
[root@TeguhLab ~]#

sample Info Output for temperature & Fan Speed
1.3.6.1.2.1.99.1.1.1.4.2 Fan #1 RPM
1.3.6.1.2.1.99.1.1.1.4.3 Fan #2 RPM
1.3.6.1.2.1.99.1.1.1.4.4 Fan #3 RPM
1.3.6.1.2.1.99.1.1.1.4.5 Fan #4 RPM
1.3.6.1.2.1.99.1.1.1.4.6 Temperature @ Ocelot
1.3.6.1.2.1.99.1.1.1.4.7 Temperature @ Switch
1.3.6.1.2.1.99.1.1.1.4.8 Temperature @ Cavium
1.3.6.1.2.1.99.1.1.1.4.9 Temperature @ Intel PHY
1.3.6.1.2.1.99.1.1.1.4.10 Temperature @ Switch Core
1.3.6.1.2.1.99.1.1.1.4.11 Temperature @ Cavium Core

3. info Temperature & Fan status

[root@TeguhLab data]# snmpwalk -v2c -c  teguht 10.10.10.10 1.3.6.1.2.1.99.1.1.1.5
SNMPv2-SMI::mib-2.99.1.1.1.5.2 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.3 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.4 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.5 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.6 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.7 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.8 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.9 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.10 = INTEGER: 1
SNMPv2-SMI::mib-2.99.1.1.1.5.11 = INTEGER: 1
[root@TeguhLab data]#

sample Info Temperature & Fan status
1.3.6.1.2.1.99.1.1.1.5.2 Fan #1 RPM
1.3.6.1.2.1.99.1.1.1.5.3 Fan #2 RPM
1.3.6.1.2.1.99.1.1.1.5.4 Fan #3 RPM
1.3.6.1.2.1.99.1.1.1.5.5 Fan #4 RPM
1.3.6.1.2.1.99.1.1.1.5.6 Temperature @ Ocelot
1.3.6.1.2.1.99.1.1.1.5.7 Temperature @ Switch
1.3.6.1.2.1.99.1.1.1.5.8 Temperature @ Cavium
1.3.6.1.2.1.99.1.1.1.5.9 Temperature @ Intel PHY
1.3.6.1.2.1.99.1.1.1.5.10 Temperature @ Switch Core
1.3.6.1.2.1.99.1.1.1.5.11 Temperature @ Cavium Core

4. Info Unit String temperature & Fan Speed

info OID Unit : 1.3.6.1.2.1.99.1.1.1.6

[root@TeguhLab ~]# snmpwalk -v2c -c teguht 10.10.10.10  1.3.6.1.2.1.99.1.1.1.6
SNMPv2-SMI::mib-2.99.1.1.1.6.2 = STRING: "rpm"
SNMPv2-SMI::mib-2.99.1.1.1.6.3 = STRING: "rpm"
SNMPv2-SMI::mib-2.99.1.1.1.6.4 = STRING: "rpm"
SNMPv2-SMI::mib-2.99.1.1.1.6.5 = STRING: "rpm"
SNMPv2-SMI::mib-2.99.1.1.1.6.6 = STRING: "(C)"
SNMPv2-SMI::mib-2.99.1.1.1.6.7 = STRING: "(C)"
SNMPv2-SMI::mib-2.99.1.1.1.6.8 = STRING: "(C)"
SNMPv2-SMI::mib-2.99.1.1.1.6.9 = STRING: "(C)"
SNMPv2-SMI::mib-2.99.1.1.1.6.10 = STRING: "(C)"
SNMPv2-SMI::mib-2.99.1.1.1.6.11 = STRING: "(C)"
[root@TeguhLab ~]#

sample Info Unit String temperature & Fan Speed
1.3.6.1.2.1.99.1.1.1.6.2 Fan #1 RPM
1.3.6.1.2.1.99.1.1.1.6.3 Fan #2 RPM
1.3.6.1.2.1.99.1.1.1.6.4 Fan #3 RPM
1.3.6.1.2.1.99.1.1.1.6.5 Fan #4 RPM
1.3.6.1.2.1.99.1.1.1.6.6 Temperature @ Ocelot
1.3.6.1.2.1.99.1.1.1.6.7 Temperature @ Switch
1.3.6.1.2.1.99.1.1.1.6.8 Temperature @ Cavium
1.3.6.1.2.1.99.1.1.1.6.9 Temperature @ Intel PHY
1.3.6.1.2.1.99.1.1.1.6.10 Temperature @ Switch Core
1.3.6.1.2.1.99.1.1.1.6.11 Temperature @ Cavium Core


5. Monitoring to NMS(Example Infosim Stablenet)


6. Monitoring to NMS(example PRTG)


sample link
https://live.paloaltonetworks.com/t5/Learning-Articles/What-is-the-SNMP-OID-for-monitoring-internal-temperature-or-CPU/ta-p/61570
https://live.paloaltonetworks.com/t5/Management-Articles/SNMP-for-Monitoring-Palo-Alto-Networks-Devices/ta-p/61052
https://live.paloaltonetworks.com/t5/Configuration-Articles/How-to-Configure-SNMPv2-on-the-Palo-Alto-Networks-Firewall/ta-p/61318
https://www.paloaltonetworks.com/documentation/misc/snmp-mibs.html

.::: Add Sensor SNMP Custom on PRTG :::.

$
0
0
The SNMP Custom sensor monitors a single parameter that is returned by a specific Object Identifier (OID) using Simple Network Management Protocol (SNMP).
This sensor shows a single numerical value (int64) for a given OID. Each OID always refers to a specific parameter of a certain SNMP device.

1. snmpwalk device and make sure output

[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.47.1.1.1.1.7.10
SNMPv2-SMI::mib-2.47.1.1.1.1.7.10 = STRING: "Temperature @ Switch Core"
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.99.1.1.1.4.10
SNMPv2-SMI::mib-2.99.1.1.1.4.10 = INTEGER: 51
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.99.1.1.1.5.10
SNMPv2-SMI::mib-2.99.1.1.1.5.10 = INTEGER: 1
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.99.1.1.1.6.10
SNMPv2-SMI::mib-2.99.1.1.1.6.10 = STRING: "(C)"
[root@TeguhLab ~]#

2. Add sensor for Device & Select SNMP Custom

3. Fill Sensor custom as example
Sensor Name: Temperature @ Switch Core by Teguh Triharto
OID Value: 1.3.6.1.2.1.99.1.1.1.4.10
Unit String: C
and save

4. monitor graph


5. Info Alam ID

.::: Add Sensor Factory on PRTG :::.

$
0
0
The Sensor Factory sensor is a powerful tool that allows you to monitor entire business processes that involve several components.
You can define one or more channels that combine monitoring results from other sensors or devices. You can create your own individual sensor with channels based on data from other sensors or devices.
Samples for usage are:
    Show single channels of one or more sensors in one graph.
    Use the data from single channels of one or more sensors to calculate new values (for example, you can subtract, multiply, and divide).
    Create graphs with data from other sensor channels and add horizontal lines at specific vertical positions.

icon-i-roundThe Sensor Factory sensor does not show values in the Downtime channel because they cannot be calculated for this sensor type.
icon-i-roundIf you want to create only a cumulated sensor status based on specific source sensors, we recommend that you use the Business Process Sensor instead.
Which channels the sensor actually shows might depend on the monitored device and the sensor setup.

1. Collect Sensor ID
Temperature @ Ocelot #2720
Temperature @ Switch #2721
Temperature @ Cavium #2722
Temperature @ Intel PHY #2723
Temperature @ Switch Core #2724
Temperature @ Cavium Core #2725

2. Add Sensor Factory

3. Fill sensor factory
Sensor Name: Temperature All by Teguh Triharto
Channel Definition:
#1:Temperature @ Ocelot
Channel(2720,0)
#2:Temperature @ Switch
Channel(2721,0)
#3:Temperature @ Cavium
Channel(2722,0)
#4:Temperature @ Intel PHY
Channel(2723,0)
#5:Temperature @ Switch Core
Channel(2724,0)
#6:Temperature @ Cavium Core
Channel(2725,0)
then Continue


4. Sensor Factory Result

5. Detail graph sample



.::: OID CPU Utilization for Monitoring CPU Windows, Linux, Appliance & Other :::.

$
0
0
CPU utilization is the sum of work handled by a Central Processing Unit. It is also used to estimate system performance. CPU utilization can vary according to the type and amount of computing task because some tasks require heavy CPU time while others require less CPU time. Process time is another name for CPU time and is the amount of time used by a CPU for processing instruction of an operating system or a computer program. CPU time is quantified in clock ticks or seconds. CPU utilization shows the burden on a processor in terms of percentage that indicates if any changes are to be made in the system otherwise it may get exhausted of capacity.

CPU utilization can be calculated by using the following formulas.

Let us define CPU utilization as U


U = 100% - (Percentage of time that is spent in idle task)


% time in idle task =

(Take the average time period of background task without load) * 100%
-------------------------------------------------------------------------------------------------------
(Avg. period of background task including some load)


Percentage time in idle task =

(BG loop count computed during 25 ms) *100%
----------------------------------------------------------------------
(BG loop count projected in an unloaded CPU)



Actual % =

Scaled % * (100%)
------------------------------
max value 8 bit value


Note: CPU utilization upsurges when a system process requires more time.

 1. OID for CPU Utilization
hrDeviceIndex     1.3.6.1.2.1.25.3.2.1.1
hrDeviceDescr hrDeviceDescr     1.3.6.1.2.1.25.3.2.1.3
hrProcessorFrwID hrProcessorFrwID     1.3.6.1.2.1.25.3.3.1.1
hrProcessorLoad hrProcessorLoad     1.3.6.1.2.1.25.3.3.1.2

2. Sample for SNMPwalk for CPU Utilization Appliance
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.11 sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: Palo Alto Networks PA-3000 series firewall
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.11 1.3.6.1.2.1.25.3.2.1.1
HOST-RESOURCES-MIB::hrDeviceIndex.1 = INTEGER: 1
HOST-RESOURCES-MIB::hrDeviceIndex.2 = INTEGER: 2
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.11 1.3.6.1.2.1.25.3.2.1.3
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Management Processor
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Slot-1 Data Processor
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.11 1.3.6.1.2.1.25.3.3.1.1
HOST-RESOURCES-MIB::hrProcessorFrwID.1 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.2 = OID: SNMPv2-SMI::zeroDotZero
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.11 1.3.6.1.2.1.25.3.3.1.2
HOST-RESOURCES-MIB::hrProcessorLoad.1 = INTEGER: 3
HOST-RESOURCES-MIB::hrProcessorLoad.2 = INTEGER: 6
[root@TeguhLab ~]#

3. Sample for SNMPwalk for CPU Utilization Linux
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: Linux TeguhLab 2.6.32-642.el6.x86_64 #1 SMP Wed Apr 13 00:51:26 EDT 2016 x86_64
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.25.3.2.1.1
HOST-RESOURCES-MIB::hrDeviceIndex.196608 = INTEGER: 196608
HOST-RESOURCES-MIB::hrDeviceIndex.196609 = INTEGER: 196609
HOST-RESOURCES-MIB::hrDeviceIndex.196610 = INTEGER: 196610
HOST-RESOURCES-MIB::hrDeviceIndex.196611 = INTEGER: 196611
HOST-RESOURCES-MIB::hrDeviceIndex.262145 = INTEGER: 262145
HOST-RESOURCES-MIB::hrDeviceIndex.262146 = INTEGER: 262146
HOST-RESOURCES-MIB::hrDeviceIndex.393232 = INTEGER: 393232
HOST-RESOURCES-MIB::hrDeviceIndex.786432 = INTEGER: 786432
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.25.3.2.1.3
HOST-RESOURCES-MIB::hrDeviceDescr.196608 = STRING: GenuineIntel: Intel(R) Xeon(R) CPU E5-2430 v2 @ 2.50GHz
HOST-RESOURCES-MIB::hrDeviceDescr.196609 = STRING: GenuineIntel: Intel(R) Xeon(R) CPU E5-2430 v2 @ 2.50GHz
HOST-RESOURCES-MIB::hrDeviceDescr.196610 = STRING: GenuineIntel: Intel(R) Xeon(R) CPU E5-2430 v2 @ 2.50GHz
HOST-RESOURCES-MIB::hrDeviceDescr.196611 = STRING: GenuineIntel: Intel(R) Xeon(R) CPU E5-2430 v2 @ 2.50GHz
HOST-RESOURCES-MIB::hrDeviceDescr.262145 = STRING: network interface lo
HOST-RESOURCES-MIB::hrDeviceDescr.262146 = STRING: network interface eth0
HOST-RESOURCES-MIB::hrDeviceDescr.393232 = STRING: SCSI disk (/dev/sda)
HOST-RESOURCES-MIB::hrDeviceDescr.786432 = STRING: Guessing that there's a floating point co-processor
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.25.3.3.1.1
HOST-RESOURCES-MIB::hrProcessorFrwID.196608 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.196609 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.196610 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.196611 = OID: SNMPv2-SMI::zeroDotZero
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.25.3.3.1.2
HOST-RESOURCES-MIB::hrProcessorLoad.196608 = INTEGER: 35
HOST-RESOURCES-MIB::hrProcessorLoad.196609 = INTEGER: 28
HOST-RESOURCES-MIB::hrProcessorLoad.196610 = INTEGER: 14
HOST-RESOURCES-MIB::hrProcessorLoad.196611 = INTEGER: 26
[root@TeguhLab ~]#

4. Sample for SNMPwalk for CPU Utilization Windows
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.20 sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: Hardware: Intel64 Family 6 Model 62 Stepping 4 AT/AT COMPATIBLE - Software: Windows Version 6.0 (Build 6002 Multiprocessor Free)
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.20 1.3.6.1.2.1.25.3.2.1.1
HOST-RESOURCES-MIB::hrDeviceIndex.1 = INTEGER: 1
HOST-RESOURCES-MIB::hrDeviceIndex.2 = INTEGER: 2
HOST-RESOURCES-MIB::hrDeviceIndex.3 = INTEGER: 3
HOST-RESOURCES-MIB::hrDeviceIndex.4 = INTEGER: 4
HOST-RESOURCES-MIB::hrDeviceIndex.5 = INTEGER: 5
HOST-RESOURCES-MIB::hrDeviceIndex.6 = INTEGER: 6
HOST-RESOURCES-MIB::hrDeviceIndex.7 = INTEGER: 7
HOST-RESOURCES-MIB::hrDeviceIndex.8 = INTEGER: 8
HOST-RESOURCES-MIB::hrDeviceIndex.9 = INTEGER: 9
HOST-RESOURCES-MIB::hrDeviceIndex.10 = INTEGER: 10
HOST-RESOURCES-MIB::hrDeviceIndex.11 = INTEGER: 11
HOST-RESOURCES-MIB::hrDeviceIndex.12 = INTEGER: 12
HOST-RESOURCES-MIB::hrDeviceIndex.13 = INTEGER: 13
HOST-RESOURCES-MIB::hrDeviceIndex.14 = INTEGER: 14
HOST-RESOURCES-MIB::hrDeviceIndex.15 = INTEGER: 15
HOST-RESOURCES-MIB::hrDeviceIndex.16 = INTEGER: 16
HOST-RESOURCES-MIB::hrDeviceIndex.17 = INTEGER: 17
HOST-RESOURCES-MIB::hrDeviceIndex.18 = INTEGER: 18
HOST-RESOURCES-MIB::hrDeviceIndex.19 = INTEGER: 19
HOST-RESOURCES-MIB::hrDeviceIndex.20 = INTEGER: 20
HOST-RESOURCES-MIB::hrDeviceIndex.21 = INTEGER: 21
HOST-RESOURCES-MIB::hrDeviceIndex.22 = INTEGER: 22
HOST-RESOURCES-MIB::hrDeviceIndex.23 = INTEGER: 23
HOST-RESOURCES-MIB::hrDeviceIndex.24 = INTEGER: 24
HOST-RESOURCES-MIB::hrDeviceIndex.25 = INTEGER: 25
HOST-RESOURCES-MIB::hrDeviceIndex.26 = INTEGER: 26
HOST-RESOURCES-MIB::hrDeviceIndex.27 = INTEGER: 27
HOST-RESOURCES-MIB::hrDeviceIndex.28 = INTEGER: 28
HOST-RESOURCES-MIB::hrDeviceIndex.29 = INTEGER: 29
HOST-RESOURCES-MIB::hrDeviceIndex.30 = INTEGER: 30
HOST-RESOURCES-MIB::hrDeviceIndex.31 = INTEGER: 31
HOST-RESOURCES-MIB::hrDeviceIndex.32 = INTEGER: 32
HOST-RESOURCES-MIB::hrDeviceIndex.33 = INTEGER: 33
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.20 1.3.6.1.2.1.25.3.2.1.3
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Microsoft XPS Document Writer
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Unknown Processor Type
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: Unknown Processor Type
HOST-RESOURCES-MIB::hrDeviceDescr.4 = STRING: Unknown Processor Type
HOST-RESOURCES-MIB::hrDeviceDescr.5 = STRING: Unknown Processor Type
HOST-RESOURCES-MIB::hrDeviceDescr.6 = STRING: Software Loopback Interface 1
HOST-RESOURCES-MIB::hrDeviceDescr.7 = STRING: WAN Miniport (SSTP)
HOST-RESOURCES-MIB::hrDeviceDescr.8 = STRING: WAN Miniport (L2TP)
HOST-RESOURCES-MIB::hrDeviceDescr.9 = STRING: WAN Miniport (PPTP)
HOST-RESOURCES-MIB::hrDeviceDescr.10 = STRING: WAN Miniport (PPPOE)
HOST-RESOURCES-MIB::hrDeviceDescr.11 = STRING: WAN Miniport (IPv6)
HOST-RESOURCES-MIB::hrDeviceDescr.12 = STRING: WAN Miniport (Network Monitor)
HOST-RESOURCES-MIB::hrDeviceDescr.13 = STRING: WAN Miniport (IP)
HOST-RESOURCES-MIB::hrDeviceDescr.14 = STRING: RAS Async Adapter
HOST-RESOURCES-MIB::hrDeviceDescr.15 = STRING: Intel(R) PRO/1000 MT Network Connection
HOST-RESOURCES-MIB::hrDeviceDescr.16 = STRING: isatap.{68793BD1-65E5-4BDE-8B15-B1131A83E0A1}
HOST-RESOURCES-MIB::hrDeviceDescr.17 = STRING: Intel(R) PRO/1000 MT Network Connection #2
HOST-RESOURCES-MIB::hrDeviceDescr.18 = STRING: isatap.{4A5C5272-63D8-4C95-9B71-4AD876C04186}
HOST-RESOURCES-MIB::hrDeviceDescr.19 = STRING: PANGP Virtual Ethernet Adapter
HOST-RESOURCES-MIB::hrDeviceDescr.20 = STRING: isatap.{5B665CE1-02A0-4D00-86F9-1D0B34FD9C66}
HOST-RESOURCES-MIB::hrDeviceDescr.21 = STRING: PANGP Virtual Ethernet Adapter-QoS Packet Scheduler-0000
HOST-RESOURCES-MIB::hrDeviceDescr.22 = STRING: WAN Miniport (IPv6)-QoS Packet Scheduler-0000
HOST-RESOURCES-MIB::hrDeviceDescr.23 = STRING: WAN Miniport (IP)-QoS Packet Scheduler-0000
HOST-RESOURCES-MIB::hrDeviceDescr.24 = STRING: WAN Miniport (Network Monitor)-QoS Packet Scheduler-0000
HOST-RESOURCES-MIB::hrDeviceDescr.25 = STRING: Intel(R) PRO/1000 MT Network Connection #2-QoS Packet Scheduler-
HOST-RESOURCES-MIB::hrDeviceDescr.26 = STRING: Intel(R) PRO/1000 MT Network Connection-QoS Packet Scheduler-000
HOST-RESOURCES-MIB::hrDeviceDescr.27 = STRING: A:\
HOST-RESOURCES-MIB::hrDeviceDescr.28 = STRING: D:\
HOST-RESOURCES-MIB::hrDeviceDescr.29 = STRING: Fixed Disk
HOST-RESOURCES-MIB::hrDeviceDescr.30 = STRING: IBM enhanced (101- or 102-key) keyboard, Subtype=(0)
HOST-RESOURCES-MIB::hrDeviceDescr.31 = STRING: LPT1:
HOST-RESOURCES-MIB::hrDeviceDescr.32 = STRING: COM1:
HOST-RESOURCES-MIB::hrDeviceDescr.33 = STRING: COM2:
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.20 1.3.6.1.2.1.25.3.3.1.1
HOST-RESOURCES-MIB::hrProcessorFrwID.2 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.3 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.4 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.5 = OID: SNMPv2-SMI::zeroDotZero
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.20 1.3.6.1.2.1.25.3.3.1.2
HOST-RESOURCES-MIB::hrProcessorLoad.2 = INTEGER: 30
HOST-RESOURCES-MIB::hrProcessorLoad.3 = INTEGER: 20
HOST-RESOURCES-MIB::hrProcessorLoad.4 = INTEGER: 26
HOST-RESOURCES-MIB::hrProcessorLoad.5 = INTEGER: 32
[root@TeguhLab ~]#

5. Table Resume CPU Utilization
6. Sample SNMP Template calculation on NMS

7. Sample Graph CPU Utilization(Load)

.::: OID Memory Utilization for Monitoring Windows, Linux :::.

$
0
0
This resource displays linear or radial gauges of both the percentage load on the CPU of the selected node and the percentage of available MEMORY on the selected node over the current monitoring period. Reported values are updated regularly, on the Polling Interval.


1. OID for CPU Utilization
hrSWRunIndex hrSWRunIndex     1.3.6.1.2.1.25.4.2.1.1 Memory Index
hrSWRunName hrSWRunName     1.3.6.1.2.1.25.4.2.1.2 Memory Name
hrSWRunPerfMem hrSWRunPerfMem     1.3.6.1.2.1.25.5.1.1.2   Memory Usage
hrMemorySize hrMemorySize     1.3.6.1.2.1.25.2.2 mem total Memory Total
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: Hardware: Intel64 Family 6 Model 62 Stepping 4 AT/AT COMPATIBLE - Software: Windows Version 6.0 (Build 6002 Multiprocessor Free)
[root@TeguhLab ~]#


2. Sample for SNMPwalk hrSWRunIndex
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.25.4.2.1.1
HOST-RESOURCES-MIB::hrSWRunIndex.1 = INTEGER: 1
HOST-RESOURCES-MIB::hrSWRunIndex.4 = INTEGER: 4
HOST-RESOURCES-MIB::hrSWRunIndex.220 = INTEGER: 220
HOST-RESOURCES-MIB::hrSWRunIndex.240 = INTEGER: 240
HOST-RESOURCES-MIB::hrSWRunIndex.296 = INTEGER: 296
HOST-RESOURCES-MIB::hrSWRunIndex.416 = INTEGER: 416
HOST-RESOURCES-MIB::hrSWRunIndex.480 = INTEGER: 480
HOST-RESOURCES-MIB::hrSWRunIndex.488 = INTEGER: 488
HOST-RESOURCES-MIB::hrSWRunIndex.532 = INTEGER: 532
HOST-RESOURCES-MIB::hrSWRunIndex.540 = INTEGER: 540
HOST-RESOURCES-MIB::hrSWRunIndex.576 = INTEGER: 576
HOST-RESOURCES-MIB::hrSWRunIndex.616 = INTEGER: 616
HOST-RESOURCES-MIB::hrSWRunIndex.628 = INTEGER: 628
HOST-RESOURCES-MIB::hrSWRunIndex.632 = INTEGER: 632
HOST-RESOURCES-MIB::hrSWRunIndex.636 = INTEGER: 636
HOST-RESOURCES-MIB::hrSWRunIndex.660 = INTEGER: 660
HOST-RESOURCES-MIB::hrSWRunIndex.676 = INTEGER: 676
HOST-RESOURCES-MIB::hrSWRunIndex.780 = INTEGER: 780
HOST-RESOURCES-MIB::hrSWRunIndex.792 = INTEGER: 792
HOST-RESOURCES-MIB::hrSWRunIndex.852 = INTEGER: 852
HOST-RESOURCES-MIB::hrSWRunIndex.888 = INTEGER: 888
HOST-RESOURCES-MIB::hrSWRunIndex.948 = INTEGER: 948
HOST-RESOURCES-MIB::hrSWRunIndex.980 = INTEGER: 980
HOST-RESOURCES-MIB::hrSWRunIndex.1012 = INTEGER: 1012
HOST-RESOURCES-MIB::hrSWRunIndex.1100 = INTEGER: 1100
HOST-RESOURCES-MIB::hrSWRunIndex.1136 = INTEGER: 1136
HOST-RESOURCES-MIB::hrSWRunIndex.1216 = INTEGER: 1216
HOST-RESOURCES-MIB::hrSWRunIndex.1312 = INTEGER: 1312
HOST-RESOURCES-MIB::hrSWRunIndex.1344 = INTEGER: 1344
HOST-RESOURCES-MIB::hrSWRunIndex.1472 = INTEGER: 1472
HOST-RESOURCES-MIB::hrSWRunIndex.1528 = INTEGER: 1528
HOST-RESOURCES-MIB::hrSWRunIndex.1548 = INTEGER: 1548
HOST-RESOURCES-MIB::hrSWRunIndex.1588 = INTEGER: 1588
HOST-RESOURCES-MIB::hrSWRunIndex.1684 = INTEGER: 1684
HOST-RESOURCES-MIB::hrSWRunIndex.1704 = INTEGER: 1704
HOST-RESOURCES-MIB::hrSWRunIndex.1776 = INTEGER: 1776
HOST-RESOURCES-MIB::hrSWRunIndex.2056 = INTEGER: 2056
HOST-RESOURCES-MIB::hrSWRunIndex.2076 = INTEGER: 2076
HOST-RESOURCES-MIB::hrSWRunIndex.2320 = INTEGER: 2320
HOST-RESOURCES-MIB::hrSWRunIndex.2344 = INTEGER: 2344
HOST-RESOURCES-MIB::hrSWRunIndex.2516 = INTEGER: 2516
HOST-RESOURCES-MIB::hrSWRunIndex.2524 = INTEGER: 2524
HOST-RESOURCES-MIB::hrSWRunIndex.2540 = INTEGER: 2540
HOST-RESOURCES-MIB::hrSWRunIndex.2552 = INTEGER: 2552
HOST-RESOURCES-MIB::hrSWRunIndex.2604 = INTEGER: 2604
HOST-RESOURCES-MIB::hrSWRunIndex.2608 = INTEGER: 2608
HOST-RESOURCES-MIB::hrSWRunIndex.2612 = INTEGER: 2612
HOST-RESOURCES-MIB::hrSWRunIndex.2660 = INTEGER: 2660
HOST-RESOURCES-MIB::hrSWRunIndex.2672 = INTEGER: 2672
HOST-RESOURCES-MIB::hrSWRunIndex.2680 = INTEGER: 2680
HOST-RESOURCES-MIB::hrSWRunIndex.2700 = INTEGER: 2700
HOST-RESOURCES-MIB::hrSWRunIndex.2716 = INTEGER: 2716
HOST-RESOURCES-MIB::hrSWRunIndex.2924 = INTEGER: 2924
HOST-RESOURCES-MIB::hrSWRunIndex.2936 = INTEGER: 2936
HOST-RESOURCES-MIB::hrSWRunIndex.3076 = INTEGER: 3076
HOST-RESOURCES-MIB::hrSWRunIndex.3168 = INTEGER: 3168
HOST-RESOURCES-MIB::hrSWRunIndex.3196 = INTEGER: 3196
HOST-RESOURCES-MIB::hrSWRunIndex.3340 = INTEGER: 3340
HOST-RESOURCES-MIB::hrSWRunIndex.3368 = INTEGER: 3368
HOST-RESOURCES-MIB::hrSWRunIndex.3576 = INTEGER: 3576
HOST-RESOURCES-MIB::hrSWRunIndex.3720 = INTEGER: 3720
HOST-RESOURCES-MIB::hrSWRunIndex.3740 = INTEGER: 3740
HOST-RESOURCES-MIB::hrSWRunIndex.3960 = INTEGER: 3960
HOST-RESOURCES-MIB::hrSWRunIndex.4040 = INTEGER: 4040
HOST-RESOURCES-MIB::hrSWRunIndex.4212 = INTEGER: 4212
HOST-RESOURCES-MIB::hrSWRunIndex.4444 = INTEGER: 4444
HOST-RESOURCES-MIB::hrSWRunIndex.4660 = INTEGER: 4660
HOST-RESOURCES-MIB::hrSWRunIndex.4664 = INTEGER: 4664
HOST-RESOURCES-MIB::hrSWRunIndex.5028 = INTEGER: 5028
HOST-RESOURCES-MIB::hrSWRunIndex.5288 = INTEGER: 5288
HOST-RESOURCES-MIB::hrSWRunIndex.5340 = INTEGER: 5340
HOST-RESOURCES-MIB::hrSWRunIndex.5360 = INTEGER: 5360
HOST-RESOURCES-MIB::hrSWRunIndex.5400 = INTEGER: 5400
HOST-RESOURCES-MIB::hrSWRunIndex.5456 = INTEGER: 5456
HOST-RESOURCES-MIB::hrSWRunIndex.6104 = INTEGER: 6104
HOST-RESOURCES-MIB::hrSWRunIndex.6368 = INTEGER: 6368
HOST-RESOURCES-MIB::hrSWRunIndex.6776 = INTEGER: 6776
HOST-RESOURCES-MIB::hrSWRunIndex.7076 = INTEGER: 7076
HOST-RESOURCES-MIB::hrSWRunIndex.9444 = INTEGER: 9444
HOST-RESOURCES-MIB::hrSWRunIndex.10276 = INTEGER: 10276
HOST-RESOURCES-MIB::hrSWRunIndex.10492 = INTEGER: 10492
HOST-RESOURCES-MIB::hrSWRunIndex.10580 = INTEGER: 10580
HOST-RESOURCES-MIB::hrSWRunIndex.11060 = INTEGER: 11060
[root@TeguhLab ~]#


3. Sample for SNMPwalk hrSWRunName
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.25.4.2.1.2
HOST-RESOURCES-MIB::hrSWRunName.1 = STRING: "System Idle Process"
HOST-RESOURCES-MIB::hrSWRunName.4 = STRING: "System"
HOST-RESOURCES-MIB::hrSWRunName.220 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.240 = STRING: "SLsvc.exe"
HOST-RESOURCES-MIB::hrSWRunName.296 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.416 = STRING: "smss.exe"
HOST-RESOURCES-MIB::hrSWRunName.480 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.488 = STRING: "csrss.exe"
HOST-RESOURCES-MIB::hrSWRunName.532 = STRING: "csrss.exe"
HOST-RESOURCES-MIB::hrSWRunName.540 = STRING: "wininit.exe"
HOST-RESOURCES-MIB::hrSWRunName.576 = STRING: "winlogon.exe"
HOST-RESOURCES-MIB::hrSWRunName.616 = STRING: "services.exe"
HOST-RESOURCES-MIB::hrSWRunName.628 = STRING: "lsass.exe"
HOST-RESOURCES-MIB::hrSWRunName.632 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.636 = STRING: "lsm.exe"
HOST-RESOURCES-MIB::hrSWRunName.660 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.676 = STRING: "ApacheMonitor.exe"
HOST-RESOURCES-MIB::hrSWRunName.780 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.792 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.852 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.888 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.948 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.980 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.1012 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.1100 = STRING: "msdtc.exe"
HOST-RESOURCES-MIB::hrSWRunName.1136 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.1216 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.1312 = STRING: "taskeng.exe"
HOST-RESOURCES-MIB::hrSWRunName.1344 = STRING: "PanGPS.exe"
HOST-RESOURCES-MIB::hrSWRunName.1472 = STRING: "spoolsv.exe"
HOST-RESOURCES-MIB::hrSWRunName.1528 = STRING: "httpd.exe"
HOST-RESOURCES-MIB::hrSWRunName.1548 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.1588 = STRING: "mysqld.exe"
HOST-RESOURCES-MIB::hrSWRunName.1684 = STRING: "_uninstall5596"
HOST-RESOURCES-MIB::hrSWRunName.1704 = STRING: "SMSvcHost.exe"
HOST-RESOURCES-MIB::hrSWRunName.1776 = STRING: "httpd.exe"
HOST-RESOURCES-MIB::hrSWRunName.2056 = STRING: "PRTG Probe.exe"
HOST-RESOURCES-MIB::hrSWRunName.2076 = STRING: "PRTG Enterprise Console.exe"
HOST-RESOURCES-MIB::hrSWRunName.2320 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.2344 = STRING: "snagent.exe"
HOST-RESOURCES-MIB::hrSWRunName.2516 = STRING: "cmd.exe"
HOST-RESOURCES-MIB::hrSWRunName.2524 = STRING: "postgres.exe"
HOST-RESOURCES-MIB::hrSWRunName.2540 = STRING: "postgres.exe"
HOST-RESOURCES-MIB::hrSWRunName.2552 = STRING: "TeamViewer_Service.exe"
HOST-RESOURCES-MIB::hrSWRunName.2604 = STRING: "postgres.exe"
HOST-RESOURCES-MIB::hrSWRunName.2608 = STRING: "postgres.exe"
HOST-RESOURCES-MIB::hrSWRunName.2612 = STRING: "postgres.exe"
HOST-RESOURCES-MIB::hrSWRunName.2660 = STRING: "tlntsvr.exe"
HOST-RESOURCES-MIB::hrSWRunName.2672 = STRING: "postgres.exe"
HOST-RESOURCES-MIB::hrSWRunName.2680 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.2700 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.2716 = STRING: "postgres.exe"
HOST-RESOURCES-MIB::hrSWRunName.2924 = STRING: "PRTG Server.exe"
HOST-RESOURCES-MIB::hrSWRunName.2936 = STRING: "postgres.exe"
HOST-RESOURCES-MIB::hrSWRunName.3076 = STRING: "mobsync.exe"
HOST-RESOURCES-MIB::hrSWRunName.3168 = STRING: "MSASCui.exe"
HOST-RESOURCES-MIB::hrSWRunName.3196 = STRING: "CCleaner64.exe"
HOST-RESOURCES-MIB::hrSWRunName.3340 = STRING: "java.exe"
HOST-RESOURCES-MIB::hrSWRunName.3368 = STRING: "dwm.exe"
HOST-RESOURCES-MIB::hrSWRunName.3576 = STRING: "taskeng.exe"
HOST-RESOURCES-MIB::hrSWRunName.3720 = STRING: "snmwagent.exe"
HOST-RESOURCES-MIB::hrSWRunName.3740 = STRING: "WmiPrvSE.exe"
HOST-RESOURCES-MIB::hrSWRunName.3960 = STRING: "vmware-usbarbitrator64.exe"
HOST-RESOURCES-MIB::hrSWRunName.4040 = STRING: "IEMonitor.exe"
HOST-RESOURCES-MIB::hrSWRunName.4212 = STRING: "explorer.exe"
HOST-RESOURCES-MIB::hrSWRunName.4444 = STRING: "IDMan.exe"
HOST-RESOURCES-MIB::hrSWRunName.4660 = STRING: "_uninstall5736"
HOST-RESOURCES-MIB::hrSWRunName.4664 = STRING: "java.exe"
HOST-RESOURCES-MIB::hrSWRunName.5028 = STRING: "PanGPA.exe"
HOST-RESOURCES-MIB::hrSWRunName.5288 = STRING: "csrss.exe"
HOST-RESOURCES-MIB::hrSWRunName.5340 = STRING: "CCleaner64.exe"
HOST-RESOURCES-MIB::hrSWRunName.5360 = STRING: "winlogon.exe"
HOST-RESOURCES-MIB::hrSWRunName.5400 = STRING: "LogonUI.exe"
HOST-RESOURCES-MIB::hrSWRunName.5456 = STRING: "rdpclip.exe"
HOST-RESOURCES-MIB::hrSWRunName.6104 = STRING: "svchost.exe"
HOST-RESOURCES-MIB::hrSWRunName.6368 = STRING: "_uninstall4316"
HOST-RESOURCES-MIB::hrSWRunName.6776 = STRING: "_uninstall7144"
HOST-RESOURCES-MIB::hrSWRunName.7076 = STRING: "mmc.exe"
HOST-RESOURCES-MIB::hrSWRunName.9444 = STRING: "cmd.exe"
HOST-RESOURCES-MIB::hrSWRunName.9940 = STRING: "AVCFree.exe"
HOST-RESOURCES-MIB::hrSWRunName.10276 = STRING: "explorer.exe"
HOST-RESOURCES-MIB::hrSWRunName.10492 = STRING: "snmp.exe"
HOST-RESOURCES-MIB::hrSWRunName.10580 = STRING: "firefox.exe"
[root@TeguhLab ~]#


4. Sample for SNMPwalk hrSWRunPerfMem
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.25.5.1.1.2
HOST-RESOURCES-MIB::hrSWRunPerfMem.1 = INTEGER: 24 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.4 = INTEGER: 4276 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.220 = INTEGER: 37868 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.240 = INTEGER: 13252 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.296 = INTEGER: 11556 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.416 = INTEGER: 1148 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.480 = INTEGER: 20932 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.488 = INTEGER: 7792 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.532 = INTEGER: 13244 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.540 = INTEGER: 5284 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.576 = INTEGER: 7700 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.616 = INTEGER: 9308 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.628 = INTEGER: 14176 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.632 = INTEGER: 25036 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.636 = INTEGER: 7444 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.660 = INTEGER: 4640 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.676 = INTEGER: 4572 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.780 = INTEGER: 6412 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.792 = INTEGER: 8516 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.852 = INTEGER: 9420 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.888 = INTEGER: 64072 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.948 = INTEGER: 6088 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.980 = INTEGER: 11696 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1012 = INTEGER: 7996 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1100 = INTEGER: 8916 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1136 = INTEGER: 12788 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1216 = INTEGER: 5264 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1312 = INTEGER: 7780 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1344 = INTEGER: 12052 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1472 = INTEGER: 15604 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1528 = INTEGER: 14016 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1548 = INTEGER: 10836 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1588 = INTEGER: 1147792 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1684 = INTEGER: 70384 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1704 = INTEGER: 23892 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.1776 = INTEGER: 15364 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2056 = INTEGER: 44604 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2076 = INTEGER: 40288 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2320 = INTEGER: 3736 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2344 = INTEGER: 21704 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2516 = INTEGER: 2524 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2524 = INTEGER: 39448 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2540 = INTEGER: 10092 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2552 = INTEGER: 15016 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2604 = INTEGER: 13052 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2608 = INTEGER: 5880 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2612 = INTEGER: 5920 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2660 = INTEGER: 5528 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2672 = INTEGER: 7964 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2680 = INTEGER: 10232 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2700 = INTEGER: 5656 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2716 = INTEGER: 8340 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2924 = INTEGER: 196984 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.2936 = INTEGER: 6344 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3076 = INTEGER: 7892 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3168 = INTEGER: 15904 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3196 = INTEGER: 17260 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3340 = INTEGER: 29436 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3368 = INTEGER: 6196 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3576 = INTEGER: 10124 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3720 = INTEGER: 6396 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3740 = INTEGER: 17140 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.3960 = INTEGER: 7984 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.4040 = INTEGER: 5820 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.4212 = INTEGER: 57688 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.4444 = INTEGER: 19200 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.4660 = INTEGER: 70444 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.4664 = INTEGER: 6230948 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.5028 = INTEGER: 13288 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.5288 = INTEGER: 5848 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.5340 = INTEGER: 22716 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.5360 = INTEGER: 5488 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.5400 = INTEGER: 14040 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.5456 = INTEGER: 8136 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.6104 = INTEGER: 6612 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.6368 = INTEGER: 70504 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.6776 = INTEGER: 70552 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.7076 = INTEGER: 28436 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.9444 = INTEGER: 3116 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.9940 = INTEGER: 243568 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.10276 = INTEGER: 26108 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.10492 = INTEGER: 9080 KBytes
HOST-RESOURCES-MIB::hrSWRunPerfMem.10580 = INTEGER: 461412 KBytes
[root@TeguhLab ~]#


5. Sample for SNMPwalk hrMemorySize
[root@TeguhLab ~]# snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.2.1.25.2.2
HOST-RESOURCES-MIB::hrMemorySize.0 = INTEGER: 16775772 KBytes
[root@TeguhLab ~]#


6. Table Total Memory Usage
 
  
7. Table Memory Utilization


 




8. Sample SNMP Template calculation on NMS


for monitoring CPU Utilization open to this


.::: How to configure remote logging with rsyslog(Enable syslog) On Linux/Rhel/Centos :::.

$
0
0
In RHEL-6 rsyslog is default logging daemon, In RHEL-5 rsyslog is available but not installed by default.

1. Install rsyslog
# yum -y install rsyslog 

2. Configure the remote server(CLIENT) to accept remote log messages using TCP/UDP.
Uncomment the following lines in the MODULES section of /etc/rsyslog.conf
[root@TeguhClientSyslog ~]# cat /etc/rsyslog.conf
.....
# Provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514

# Provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514
.....
[root@TeguhClientSyslog ~]# cat /etc/rsyslog.conf


change to

[root@TeguhClientSyslog ~]# cat /etc/rsyslog.conf
.....
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
.....
[root@TeguhClientSyslog ~]#

[root@TeguhClientSyslog ~]# cat /etc/rsyslog.conf  | grep "ModLoad imtcp"
$ModLoad imtcp
[root@TeguhClientSyslog ~]# cat /etc/rsyslog.conf  | grep "InputTCPServerRun"
$InputTCPServerRun 514
[root@TeguhClientSyslog ~]#


Restart rsyslog
[root@TeguhClientSyslog ~]# systemctl restart rsyslog
[root@TeguhClientSyslog ~]# service rsyslog restart
Redirecting to /bin/systemctl restart rsyslog.service
[root@TeguhClientSyslog ~]#


3. Install syslog watcher or other NMS to catch syslog(CLIENT PC) Optional
https://nchc.dl.sourceforge.net/project/syslog-server/syslog-server/1.2.x/SyslogServer-1.2.3-win32.exe

https://bbuseruploads.s3.amazonaws.com/0d2c3bf4-a97c-40b5-b347-2c7c47f5335d/downloads/f0267815-de8f-4d04-a7a8-2fb3f9fd00f9/Tftpd64-4.60-setup.exe?Signature=7m6m2Qx06wmoh4oU96NDZXAVPuc%3D&Expires=1517986687&AWSAccessKeyId=AKIAIQWXW6WLXMB5QZAQ&versionId=UtVhbStg7XQeycUxOhALgISiCluw8RcA&response-content-disposition=attachment%3B%20filename%3D%22Tftpd64-4.60-setup.exe%22


4. Configure the rsyslog Server(SERVER) to rsyslog/syslog watcher TCP/UDP.
Add the following line to the RULES section of /etc/rsyslog.conf

# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
#using UDP
*.*  @10.10.10.10:514
*.*  @10.10.10.20:514
#using TCP
*.*  @@10.10.10.10:514
*.*  @@10.10.10.20:514
# ### end of the forwarding rule ###

You can also specify the severity to send, for example info messages:
Raw

*.info      @@10.10.10.10:514

sample log

[root@TeguhServerSyslog /]# cat /etc/rsyslog.conf
.....
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
#Using UDP Port
*.*  @10.10.10.10:514
*.*  @10.10.10.20:514

#Using TCP Port
*.*  @@10.10.10.10:514
*.*  @@10.10.10.20:514
# ### end of the forwarding rule ###

[root@TeguhServerSyslog /]#

Restart rsyslog.
[root@TeguhServerSyslog /]# service rsyslog restart
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]
[root@TeguhServerSyslog /]# service rsyslog status
rsyslogd (pid  1008) is running...
[root@TeguhServerSyslog /]#

3.  Test Configuration
on SERVER Rsyslog
[root@TeguhServerSyslog /]# logger "Teguh Triharto Corporation"
[root@TeguhServerSyslog /]# tail /var/log/messages
Feb  7 14:38:40 TeguhServerSyslog rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1008" x-info="http://www.rsyslog.com"] start
Feb  7 14:39:53 TeguhServerSyslog root: Teguh Triharto Corporation
Feb  7 14:40:48 TeguhServerSyslog root: Teguh Triharto Corporation
[root@TeguhServerSyslog /]#

On Client Rsyslog

[root@TeguhClientSyslog ~]# tail /var/log/messages
Feb  7 15:01:52 TeguhClientSyslog rsyslogd: [origin software="rsyslogd" swVersion="8.24.0" x-pid="5065" x-info="http://www.rsyslog.com"] start
Feb  7 15:01:52 TeguhClientSyslog systemd: Started System Logging Service.
Feb  7 15:07:44 TeguhServerSyslog root: Teguh Triharto Corporation
Feb  7 15:07:44 TeguhServerSyslog root: Teguh Triharto Corporation
[root@TeguhClientSyslog ~]#

4. On SyslogWatcher on Windows(CLient)

https://access.redhat.com/solutions/54363

.::: How to Install Elastix 4 & Elastix Call Center Service Using Repolocal/rpm/yum :::.

$
0
0
Elastix is an unified communications server software that brings together IP PBX, email, IM, faxing and collaboration functionality. It has a Web interface and includes capabilities such as a call center software with predictive dialing. The Elastix 2.5 functionality is based on open source projects including Asterisk, FreePBX, HylaFAX, Openfire and Postfix. Those packages offer the PBX, fax, instant messaging and email functions, respectively. As of Elastix 5.0 all functionality is provided through 3CX, a software based private branch exchange (PBX) based on the SIP (Session Initiation Protocol) standard. It enables extensions to make calls via the public switched telephone network (PSTN) or via Voice over Internet Protocol (VoIP) services. Elastix 5.0 is an IP business phone system that supports standard SIP soft/hard phones, VoIP services and traditional PSTN phone lines. Elastix 2.5 is free software, released under the GNU General Public License. Elastix 5.0 is Proprietary released under the terms of the 3CX license

1. Download or copy to disk
[root@elastix-phone-teguht ~]# cd /data/
[root@elastix-phone-teguht data]# ls
Elastix-4.0.76-Stable-x86_64-bin-05Sep2016.iso
[root@elastix-phone-teguht data]# cp Elastix-4.0.76-Stable-x86_64-bin-05Sep2016.iso elastix4.iso
[root@elastix-phone-teguht data]# ls
Elastix-4.0.76-Stable-x86_64-bin-05Sep2016.iso  elastix4.iso
[root@elastix-phone-teguht data]#

or
wget https://sourceforge.net/projects/vaak/files/Elastix/4/Elastix-4.0.76-Stable-x86_64-bin-05Sep2016.iso/download
wget https://nchc.dl.sourceforge.net/project/vaak/Elastix/4/Elastix-4.0.76-Stable-x86_64-bin-05Sep2016.iso

2. Mounting
root@elastix-phone-teguht data]# mkdir /mnt/elastix4
[root@elastix-phone-teguht data]# mount -o loop /data/elastix4.iso /mnt/elastix4/
mount: /dev/loop0 is write-protected, mounting read-only
[root@elastix-phone-teguht data]# df -kh
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   35G  5.9G   30G  17% /
devtmpfs                 2.3G     0  2.3G   0% /dev
tmpfs                    2.3G     0  2.3G   0% /dev/shm
tmpfs                    2.3G  9.6M  2.3G   1% /run
tmpfs                    2.3G     0  2.3G   0% /sys/fs/cgroup
/dev/sda1               1014M  179M  836M  18% /boot
tmpfs                    467M  8.0K  467M   1% /run/user/991
tmpfs                    467M     0  467M   0% /run/user/0
/dev/loop0               1.3G  1.3G     0 100% /mnt/elastix4
[root@elastix-phone-teguht data]#

3. Create repolocal
[root@elastix-phone-teguht data]# cat /etc/yum.repos.d/Elastix.repo
[Elastix-cd]
name=Elastix-cd
baseurl=file:///mnt/elastix4
gpgcheck=0
enabled=1
[root@elastix-phone-teguht data]#

4. Disable SElinux
[root@elastix-repo data]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@elastix-repo data]#

5. Install elastix
# yum -y install epel-release
# yum -y install htop glances screen fail2ban wget sysstat net-tools
# yum -y install elastix

[root@elastix-phone-teguht data]# cd /mnt/Elastix/
[root@elastix-phone-teguht Elastix]#
[root@elastix-phone-teguht Elastix]# pwd
/mnt/elastix4/Elastix
[root@elastix-phone-teguht Elastix]# yum -y install epel-release
[root@elastix-phone-teguht Elastix]# yum -y install htop glances screen fail2ban wget sysstat net-tools
[root@elastix-phone-teguht Elastix]# yum -y install elastix

6. configuration after installation

# systemctl enable mariadb.service
# systemctl enable httpd
# echo "if Firewall enable"
# systemctl enable firewalld
# systemctl start firewalld
# firewall-cmd --zone=public --add-port=443/tcp --permanent
# firewall-cmd --reload
# echo "if Firewall disable"
# systemctl disable firewalld
# systemctl stop firewalld
# systemctl start mariadb
# systemctl enable elastix-firstboot
# /etc/init.d/elastix-firstboot start && reboot

7. Configure mariadb & user web admin
MySQL user: root , password: root
WebAdmin user: admin , password


8. Waiting 30-60 minute


9 Login to Elastix web
http://22.22.22.22
user: admin
password: admin


10. if you want to activate Elastix Call Center
# yum -y install elastix-callcenter

11. Start Elastix Call Center Service & Check New Dashboard


.::: Create Graph Template Cacti base on OID/MIB :::.

$
0
0
Once one or more data sources are defined, an RRDTool graph can be created using the data. Cacti allows you to create almost any imaginable RRDTool graph using all of the standard RRDTool graph types and consolidation functions. A color selection area and automatic text padding function also aid in the creation of graphs to make the process easier.

Not only can you create RRDTool based graphs in cacti, but there are many ways to display them. Along with a standard "list view" and a "preview mode", which resembles the RRDTool frontend 14all, there is a "tree view", which allows you to put graphs onto a hierarchical tree for organizational purposes.

base on sample http://teguhth.blogspot.co.id/2018/01/monitoring-oidmib-temperature-fan-speed.html
A. Create Data Template
1. Console -> Data Template -> Add

2. Fill Data Template
  Data Templates
  Name : Temperature @ Ocelot
 

  Data Source
  Name : |host_description| - Temperature @ Ocelot
  Data Input Method : Get SNMP Data
  Associated RRA's : Daily, Weekly, Mounthly, Yearly
 
  Data Source Item
  Internal Data Source Name : Temp_ocelot
  Minimum Value : Check
  Maximum Value : Check
  Data Source Type : Gauge
 
  and Create

3. fill Custom Data
  OID : .1.3.6.1.2.1.99.1.1.1.4.6
  and save

4. for other temperature, repeate step 2 & step 3

B. Create Graph Template
1. Console -> Graph Template -> Add

2. Fill as
  Template
  Name : PaloAlto - Temperature
  Graph Template
  Title : |host_description| - PaloAlto - Temperature
  Upper Limit : Check
  Lower Limit : Check
  Vertical Lebel : Celcius
 
  then Create
 
3. Add Graph Template Item

  Data Source : Temperature @ Ocelot(Temp_ocelot)
  Color : FFAB00
  Graph Item Type : Line1
  Consolidation Function : Average
  GPRINT Type : Normal
  Text Format Temp@Ocelot
  then Create
 
4. Repeate for number 3 for other hardware
5. and save


C. Add Associated Graph Templates
1. Console > Devices -> Device(IP)
2. Add Graph Template = PaloAlto - Temperature and press button Add

3. Then press button Save
4. Create Graphs for This Host

5. Select Create: PaloAlto - Temperature and create and create


D. Showing Graph on Device Tree




 
 

.::: Create CDEF's on Cacti to Multiple or Division or other Calculation Mathematical Functions :::.

$
0
0
CDEFs allow you to apply mathematical functions to graph data to alter output. The concept of a CDEF comes straight from RRDTool, and are written in reverse polish notation (RPN). For more information regarding the syntax of CDEFs,

1. Console -> Management -> CDEF's -> New
  Name : Reamur

2. fill CDEF Item
cdef=CURRENT_DATA_SOURCE,4,*,5,/
CDEF Items     Add   
Item     Item Value     
Item #1     Special Data Source: CURRENT_DATA_SOURCE     Move Down Move Up     Delete
Item #2     Custom String: 4     Move Down Move Up     Delete
Item #3     Operator: *     Move Down Move Up     Delete
Item #4     Custom String: 5     Move Down Move Up     Delete
Item #5     Operator: /     Move Down Move Up     Delete

3. Change Graph Template
 Template : PaloAlto - Temperature - Reamur
 Vertical Label (--vertical-label) = Reamur

4. CDEF FUnction = change to Reamur an save

5. additional Associatied graph templeate on device (Temperature reamure) add an save

6. Create Graphs for This Host

7. Select Create: Temperature Reamur and create and create

8. sample graph using CDEF and none
Using CDEF FUnction

Non Using CDEF

  http://informasitips.com/cara-konversi-suhu-dari-celcius-ke-reamur-fahrenheit-dan-kelvin

.::: Install OpenStack Newton All In One with Heat Service on CentOS 7 (Lab Verified) :::.

$
0
0
OpenStack is a free and open-source software platform for cloud computing, mostly deployed as infrastructure-as-a-service (IaaS), whereby virtual servers and other resources are made available to customers.The software platform consists of interrelated components that control diverse, multi-vendor hardware pools of processing, storage, and networking resources throughout a data center. Users either manage it through a web-based dashboard, through command-line tools, or through RESTful web services.

1. Disable SELinux
[root@openstack /]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

2. Disable firewall

# systemctl stop firewalld
# systemctl disable firewalld
# systemctl status firewalld

[root@openstack-Teguht data]# systemctl stop firewalld
[root@openstack-Teguht data]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@openstack-Teguht data]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

Apr 09 16:35:17 openstack-Teguht systemd[1]: Starting firewalld - dynamic firewall da.....
Apr 09 16:36:25 openstack-Teguht systemd[1]: Started firewalld - dynamic firewall daemon.
Apr 09 16:36:31 openstack-Teguht firewalld[892]: WARNING: ICMP type 'beyond-scope' is...6.
Apr 09 16:36:31 openstack-Teguht firewalld[892]: WARNING: beyond-scope: INVALID_ICMPT...e.
Apr 09 16:36:31 openstack-Teguht firewalld[892]: WARNING: ICMP type 'failed-policy' i...6.
Apr 09 16:36:31 openstack-Teguht firewalld[892]: WARNING: failed-policy: INVALID_ICMP...e.
Apr 09 16:36:32 openstack-Teguht firewalld[892]: WARNING: ICMP type 'reject-route' is...6.
Apr 09 16:36:32 openstack-Teguht firewalld[892]: WARNING: reject-route: INVALID_ICMPT...e.
Apr 09 16:41:15 openstack-Teguht systemd[1]: Stopping firewalld - dynamic firewall da.....
Apr 09 16:41:16 openstack-Teguht systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@openstack-Teguht data]#

3. Setting host
[root@openstack-Teguht data]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.10 openstack-Teguht
[root@openstack-Teguht data]#

4. Install SNMPD
# rpm -q net-snmp net-snmp-libs net-snmp-utils net-snmp-perl net-snmp-python
# yum -y install net-snmp net-snmp-libs net-snmp-utils net-snmp-perl net-snmp-python
# rpm -q net-snmp net-snmp-libs net-snmp-utils net-snmp-perl net-snmp-python

5. Update to lastest version(recomandded)
[root@openstack-Teguht ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[root@openstack-Teguht ~]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
[root@openstack-Teguht ~]# yum -y update
[root@openstack-Teguht ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[root@openstack-Teguht ~]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
[root@openstack-Teguht ~]#

6. Disable NetworkManager

# systemctl disable NetworkManager
# systemctl stop NetworkManager
# systemctl status NetworkManager

[root@openstack-Teguht ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
[root@openstack-Teguht ~]# systemctl stop NetworkManager
[root@openstack-Teguht ~]# systemctl status NetworkManager
● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2018-04-09 17:04:36 WIB; 22s ago
     Docs: man:NetworkManager(8)
 Main PID: 835 (code=exited, status=0/SUCCESS)

Apr 09 16:43:44 openstack-Teguht NetworkManager[835]: <info>  [1523267024.9526] device...0
Apr 09 16:53:51 openstack-Teguht NetworkManager[835]: <info>  [1523267631.2768] manage...d
Apr 09 16:53:55 openstack-Teguht NetworkManager[835]: <info>  [1523267635.7880] manage...d
Apr 09 16:54:41 openstack-Teguht NetworkManager[835]: <info>  [1523267681.3774] manage...d
Apr 09 16:55:05 openstack-Teguht NetworkManager[835]: <info>  [1523267705.2705] manage...d
Apr 09 16:55:09 openstack-Teguht NetworkManager[835]: <info>  [1523267709.6518] manage...d
Apr 09 17:04:36 openstack-Teguht NetworkManager[835]: <info>  [1523268276.4074] caught....
Apr 09 17:04:36 openstack-Teguht systemd[1]: Stopping Network Manager...
Apr 09 17:04:36 openstack-Teguht NetworkManager[835]: <info>  [1523268276.4082] device...0
Apr 09 17:04:36 openstack-Teguht systemd[1]: Stopped Network Manager.
Hint: Some lines were ellipsized, use -l to show in full.
[root@openstack-Teguht ~]#

7. Disable Mariadb
# yum erase mariadb-libs -y

8.  Install RDO repository
# wget https://repos.fedorapeople.org/repos/openstack/openstack-newton/rdo-release-newton-4.noarch.rpm
# yum -y install https://repos.fedorapeople.org/repos/openstack/openstack-newton/rdo-release-newton-4.noarch.rpm

optional
# yum -y install https://repos.fedorapeople.org/repos/openstack/openstack-newton/rdo-release-newton-5.noarch.rpm

9. Launch OpenStack Newton packstack automated installation with parameters
# packstack --allinone --provision-demo=n --os-heat-install=y

[root@openstack-Teguht ~]# packstack --allinone --provision-demo=n --os-heat-install=y
Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20180409-170650-tAsuOP/openstack-setup.log
Packstack changed given value  to required value /root/.ssh/id_rsa.pub

Installing:
Clean Up                                             [ DONE ]
Discovering ip protocol version                      [ DONE ]
Setting up ssh keys                                  [ DONE ]
Preparing servers                                    [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Preparing pre-install entries                        [ DONE ]
Setting up CACERT                                    [ DONE ]
Preparing AMQP entries                               [ DONE ]
Preparing MariaDB entries                            [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries                           [ DONE ]
Preparing Glance entries                             [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries                             [ DONE ]
Preparing Nova API entries                           [ DONE ]
Creating ssh keys for Nova migration                 [ DONE ]
Gathering ssh host keys for Nova migration           [ DONE ]
Preparing Nova Compute entries                       [ DONE ]
Preparing Nova Scheduler entries                     [ DONE ]
Preparing Nova VNC Proxy entries                     [ DONE ]
Preparing OpenStack Network-related Nova entries     [ DONE ]
Preparing Nova Common entries                        [ DONE ]
Preparing Neutron LBaaS Agent entries                [ DONE ]
Preparing Neutron API entries                        [ DONE ]
Preparing Neutron L3 entries                         [ DONE ]
Preparing Neutron L2 Agent entries                   [ DONE ]
Preparing Neutron DHCP Agent entries                 [ DONE ]
Preparing Neutron Metering Agent entries             [ DONE ]
Checking if NetworkManager is enabled and running    [ DONE ]
Preparing OpenStack Client entries                   [ DONE ]
Preparing Horizon entries                            [ DONE ]
Preparing Swift builder entries                      [ DONE ]
Preparing Swift proxy entries                        [ DONE ]
Preparing Swift storage entries                      [ DONE ]
Preparing Heat entries                               [ DONE ]
Preparing Heat CloudFormation API entries            [ DONE ]
Preparing Gnocchi entries                            [ DONE ]
Preparing MongoDB entries                            [ DONE ]
Preparing Redis entries                              [ DONE ]
Preparing Ceilometer entries                         [ DONE ]
Preparing Aodh entries                               [ DONE ]
Preparing Nagios server entries                      [ DONE ]
Preparing Nagios host entries                        [ DONE ]
Preparing Puppet manifests                           [ DONE ]
Copying Puppet modules and manifests                 [ DONE ]
Applying 10.10.10.10_controller.pp
Testing if puppet apply is finished: 10.10.10.10_controller.pp  [ - ]
10.10.10.10_controller.pp:                         [ DONE ]         
Applying 10.10.10.10_network.pp
10.10.10.10_network.pp:                            [ DONE ]      
Applying 10.10.10.10_compute.pp
10.10.10.10_compute.pp:                            [ DONE ]      
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]

 **** Installation completed successfully ******

Additional information:
 * A new answerfile was created in: /root/packstack-answers-20180409-170651.txt
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
 * File /root/keystonerc_admin has been created on OpenStack client host 10.10.10.10. To use the command line tools you need to source the file.
 * To access the OpenStack Dashboard browse to http://10.10.10.10/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
 * To use Nagios, browse to http://10.10.10.10/nagios username: nagiosadmin, password: 3b718ea1c2924cbd
 * Because of the kernel update the host 10.10.10.10 requires reboot.
 * The installation log file is available at: /var/tmp/packstack/20180409-170650-tAsuOP/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20180409-170650-tAsuOP/manifests
[root@openstack-Teguht ~]#
[root@openstack-Teguht ~]#

10. Post Installation
http://10.10.10.10/dashboard

[root@openstack-Teguht ~]# cat /root/keystonerc_admin
unset OS_SERVICE_TOKEN
    export OS_USERNAME=admin
    export OS_PASSWORD=3b6715f6d8f84c82
    export OS_AUTH_URL=http://10.10.10.10:5000/v2.0
    export PS1='[\u@\h \W(keystone_admin)]\$ '
   
export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne
    [root@openstack-Teguht ~]#
   
11. Change password admin for your request
[root@openstack-Teguht ~]# cat /root/keystonerc_admin
unset OS_SERVICE_TOKEN
    export OS_USERNAME=admin
#    export OS_PASSWORD=3b6715f6d8f84c82
export OS_PASSWORD=admin
    export OS_AUTH_URL=http://10.10.10.10:5000/v2.0
    export PS1='[\u@\h \W(keystone_admin)]\$ '
   
export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne
   
[root@openstack-Teguht ~]#

12. Configure network interfaces (bind ens160 interface as a port to OVS bridge br-ex)
Create br-ex network interface file based on ens160 interface file:
ovs-vsctl add-port br-ex ens160; systemctl restart network

.::: backup & copy :::.

[root@openstack-Teguht data]# cp /etc/sysconfig/network-scripts/ifcfg-ens160 /data/ifcfg-ens160.backup
[root@openstack-Teguht data]# ls
ifcfg-ens160.backup  rdo-release-newton-4.noarch.rpm
[root@openstack-Teguht data]# cp /etc/sysconfig/network-scripts/ifcfg-ens160 /etc/sysconfig/network-scripts/ifcfg-br-ex

capture before additional port
[root@openstack-Teguht data]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:0c:29:1d:18:c2 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.10/24 brd 10.10.10.255 scope global ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::5d3b:197a:bef8:1b39/64 scope link
       valid_lft forever preferred_lft forever
5: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 2e:7c:6a:f4:28:62 brd ff:ff:ff:ff:ff:ff
6: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN qlen 1000
    link/ether 52:42:e6:7e:80:4b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5042:e6ff:fe7e:804b/64 scope link
       valid_lft forever preferred_lft forever
7: br-int: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 62:19:d5:8d:73:4f brd ff:ff:ff:ff:ff:ff
8: br-tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether ba:a2:a3:ff:c3:48 brd ff:ff:ff:ff:ff:ff
[root@openstack-Teguht data]#
[root@openstack-Teguht data]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens160
UUID=dceb2a97-8d7e-4a21-9b02-af980d6c60d0
DEVICE=ens160
ONBOOT=yes
IPADDR=10.10.10.10
PREFIX=24
GATEWAY=10.10.10.1
DNS1=8.8.8.8
IPV6_PRIVACY=no
[root@openstack-Teguht data]#

.::: Modify ifcfg-ens160 file to look like below: :::.

DEVICE=eth0
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex

[root@openstack-Teguht data]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens160
UUID=dceb2a97-8d7e-4a21-9b02-af980d6c60d0
DEVICE=ens160
ONBOOT=yes
IPADDR=10.10.10.10
PREFIX=24
GATEWAY=10.10.10.1
DNS1=8.8.8.8
IPV6_PRIVACY=no
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex
[root@openstack-Teguht data]#


Modify ifcfg-br-ex file to look like below:

TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
NAME=br-ex
DEVICE=br-ex
ONBOOT=yes
IPADDR=10.10.10.10
PREFIX=24
GATEWAY=10.10.10.1
PEERDNS=no
NM_CONTROLLED=no

[root@openstack-Teguht data]# cat /etc/sysconfig/network-scripts/ifcfg-br-ex
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=br-ex
UUID=dceb2a97-8d7e-4a21-9b02-af980d6c60d0
DEVICE=br-ex
ONBOOT=yes
IPADDR=10.10.10.10
PREFIX=24
GATEWAY=10.10.10.1
DNS1=8.8.8.8
IPV6_PRIVACY=no
PEERDNS=no
NM_CONTROLLED=no
[root@openstack-Teguht data]#

13. Restart network service 
# ovs-vsctl add-port br-ex ens160; systemctl restart network

root@openstack-Teguht ~]# ovs-vsctl add-port br-ex ens160; systemctl restart network

[root@openstack-Teguht ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP qlen 1000
    link/ether 00:0c:29:1d:18:c2 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.10/24 brd 10.10.10.255 scope global ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe1d:18c2/64 scope link
       valid_lft forever preferred_lft forever
5: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 2e:7c:6a:f4:28:62 brd ff:ff:ff:ff:ff:ff
6: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN qlen 1000
    link/ether 00:0c:29:1d:18:c2 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.10/24 brd 10.10.10.255 scope global br-ex
       valid_lft forever preferred_lft forever
    inet6 fe80::5042:e6ff:fe7e:804b/64 scope link
       valid_lft forever preferred_lft forever
7: br-int: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 62:19:d5:8d:73:4f brd ff:ff:ff:ff:ff:ff
8: br-tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether ba:a2:a3:ff:c3:48 brd ff:ff:ff:ff:ff:ff
[root@openstack-Teguht ~]# ifconfig -a
br-ex: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.10.10  netmask 255.255.255.0  broadcast 10.10.10.255
        inet6 fe80::5042:e6ff:fe7e:804b  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:1d:18:c2  txqueuelen 1000  (Ethernet)
        RX packets 2681  bytes 143953 (140.5 KiB)
        RX errors 0  dropped 9  overruns 0  frame 0
        TX packets 278  bytes 42132 (41.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

br-int: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 62:19:d5:8d:73:4f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

br-tun: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether ba:a2:a3:ff:c3:48  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.10.10  netmask 255.255.255.0  broadcast 10.10.10.255
        inet6 fe80::20c:29ff:fe1d:18c2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:1d:18:c2  txqueuelen 1000  (Ethernet)
        RX packets 2317  bytes 159030 (155.3 KiB)
        RX errors 0  dropped 10  overruns 0  frame 0
        TX packets 181  bytes 27272 (26.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 10449116  bytes 1532759795 (1.4 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10449116  bytes 1532759795 (1.4 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ovs-system: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 2e:7c:6a:f4:28:62  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@openstack-Teguht ~]#

14. Verify OpenStack status after packstack installation

# source /root/keystonerc_admin
# nova host-list
# nova service-list
# systemctl list-unit-files | grep openstack
# systemctl list-unit-files | grep openstack-heat
# openstack host list
# openstack compute service list

[root@openstack-Teguht ~]# cat /root/keystonerc_admin
unset OS_SERVICE_TOKEN
    export OS_USERNAME=admin
#    export OS_PASSWORD=3b6715f6d8f84c82
export OS_PASSWORD=admin
    export OS_AUTH_URL=http://10.10.10.10:5000/v2.0
    export PS1='[\u@\h \W(keystone_admin)]\$ '
   
export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne
   
[root@openstack-Teguht ~]# source /root/keystonerc_admin
[root@openstack-Teguht ~(keystone_admin)]#  nova host-list
+-------------------+-------------+----------+
| host_name         | service     | zone     |
+-------------------+-------------+----------+
| openstack-Teguht | cert        | internal |
| openstack-Teguht | consoleauth | internal |
| openstack-Teguht | scheduler   | internal |
| openstack-Teguht | conductor   | internal |
| openstack-Teguht | compute     | nova     |
+-------------------+-------------+----------+
[root@openstack-Teguht ~(keystone_admin)]# nova service-list
+----+------------------+-------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host              | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+-------------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-cert        | openstack-Teguht | internal | enabled | up    | 2018-04-10T07:46:22.000000 | -               |
| 2  | nova-consoleauth | openstack-Teguht | internal | enabled | up    | 2018-04-10T07:46:23.000000 | -               |
| 5  | nova-scheduler   | openstack-Teguht | internal | enabled | up    | 2018-04-10T07:46:22.000000 | -               |
| 6  | nova-conductor   | openstack-Teguht | internal | enabled | up    | 2018-04-10T07:46:18.000000 | -               |
| 7  | nova-compute     | openstack-Teguht | nova     | enabled | up    | 2018-04-10T07:46:19.000000 | -               |
+----+------------------+-------------------+----------+---------+-------+----------------------------+-----------------+
[root@openstack-Teguht ~(keystone_admin)]# neutron agent-list
+------------+------------+------------+-------------------+-------+----------------+----------------+
| id         | agent_type | host       | availability_zone | alive | admin_state_up | binary         |
+------------+------------+------------+-------------------+-------+----------------+----------------+
| 18730b86-3 | L3 agent   | openstack- | nova              | :-)   | True           | neutron-l3-age |
| 206-484e-  |            | install    |                   |       |                | nt             |
| 802a-d064e |            |            |                   |       |                |                |
| 282ab49    |            |            |                   |       |                |                |
| 1892cabe-9 | Open       | openstack- |                   | :-)   | True           | neutron-       |
| 634-406f-  | vSwitch    | install    |                   |       |                | openvswitch-   |
| 90da-7fc42 | agent      |            |                   |       |                | agent          |
| 38b569b    |            |            |                   |       |                |                |
| 3b1c69ca-  | Metadata   | openstack- |                   | :-)   | True           | neutron-       |
| 41a5-4583  | agent      | install    |                   |       |                | metadata-agent |
| -9d0f-2aab |            |            |                   |       |                |                |
| 9441fdb1   |            |            |                   |       |                |                |
| a7aa1993-7 | Metering   | openstack- |                   | :-)   | True           | neutron-       |
| d1f-4892-a | agent      | install    |                   |       |                | metering-agent |
| 499-70284f |            |            |                   |       |                |                |
| f032a3     |            |            |                   |       |                |                |
| f2593b12-0 | DHCP agent | openstack- | nova              | :-)   | True           | neutron-dhcp-  |
| cf5-4b67   |            | install    |                   |       |                | agent          |
| -815b-707d |            |            |                   |       |                |                |
| 193e9c1b   |            |            |                   |       |                |                |
+------------+------------+------------+-------------------+-------+----------------+----------------+
[root@openstack-Teguht ~(keystone_admin)]# systemctl list-unit-files | grep openstack
openstack-aodh-api.service                    disabled
openstack-aodh-evaluator.service              enabled
openstack-aodh-listener.service               enabled
openstack-aodh-notifier.service               enabled
openstack-ceilometer-api.service              disabled
openstack-ceilometer-central.service          enabled
openstack-ceilometer-collector.service        enabled
openstack-ceilometer-compute.service          enabled
openstack-ceilometer-notification.service     enabled
openstack-ceilometer-polling.service          disabled
openstack-cinder-api.service                  enabled
openstack-cinder-backup.service               enabled
openstack-cinder-scheduler.service            enabled
openstack-cinder-volume.service               enabled
openstack-glance-api.service                  enabled
openstack-glance-glare.service                disabled
openstack-glance-registry.service             enabled
openstack-glance-scrubber.service             disabled
openstack-gnocchi-api.service                 disabled
openstack-gnocchi-metricd.service             enabled
openstack-gnocchi-statsd.service              enabled
openstack-heat-api-cfn.service                enabled
openstack-heat-api.service                    enabled
openstack-heat-engine.service                 enabled
openstack-losetup.service                     enabled
openstack-nova-api.service                    enabled
openstack-nova-cert.service                   enabled
openstack-nova-compute.service                enabled
openstack-nova-conductor.service              enabled
openstack-nova-console.service                disabled
openstack-nova-consoleauth.service            enabled
openstack-nova-metadata-api.service           disabled
openstack-nova-novncproxy.service             enabled
openstack-nova-os-compute-api.service         disabled
openstack-nova-scheduler.service              enabled
openstack-nova-xvpvncproxy.service            disabled
openstack-swift-account-auditor.service       enabled
openstack-swift-account-auditor@.service      disabled
openstack-swift-account-reaper.service        enabled
openstack-swift-account-reaper@.service       disabled
openstack-swift-account-replicator.service    enabled
openstack-swift-account-replicator@.service   disabled
openstack-swift-account.service               enabled
openstack-swift-account@.service              disabled
openstack-swift-container-auditor.service     enabled
openstack-swift-container-auditor@.service    disabled
openstack-swift-container-reconciler.service  disabled
openstack-swift-container-replicator.service  enabled
openstack-swift-container-replicator@.service disabled
openstack-swift-container-updater.service     enabled
openstack-swift-container-updater@.service    disabled
openstack-swift-container.service             enabled
openstack-swift-container@.service            disabled
openstack-swift-object-auditor.service        enabled
openstack-swift-object-auditor@.service       disabled
openstack-swift-object-expirer.service        enabled
openstack-swift-object-reconstructor.service  disabled
openstack-swift-object-reconstructor@.service disabled
openstack-swift-object-replicator.service     enabled
openstack-swift-object-replicator@.service    disabled
openstack-swift-object-updater.service        enabled
openstack-swift-object-updater@.service       disabled
openstack-swift-object.service                enabled
openstack-swift-object@.service               disabled
openstack-swift-proxy.service                 enabled
[root@openstack-Teguht ~(keystone_admin)]# systemctl list-unit-files | grep openstack-heat
openstack-heat-api-cfn.service                enabled
openstack-heat-api.service                    enabled
openstack-heat-engine.service                 enabled
[root@openstack-Teguht ~(keystone_admin)]#

[root@openstack-Teguht ~(keystone_admin)]# openstack host list
+-------------------+-------------+----------+
| Host Name         | Service     | Zone     |
+-------------------+-------------+----------+
| openstack-Teguht | cert        | internal |
| openstack-Teguht | consoleauth | internal |
| openstack-Teguht | scheduler   | internal |
| openstack-Teguht | conductor   | internal |
| openstack-Teguht | compute     | nova     |
+-------------------+-------------+----------+

[root@openstack-Teguht ~(keystone_admin)]# openstack compute service list
+----+-----------------+-----------------+----------+---------+-------+-------------------+
| ID | Binary          | Host            | Zone     | Status  | State | Updated At        |
+----+-----------------+-----------------+----------+---------+-------+-------------------+
|  1 | nova-cert       | openstack-      | internal | enabled | up    | 2018-04-10T07:47: |
|    |                 | install         |          |         |       | 42.000000         |
|  2 | nova-           | openstack-      | internal | enabled | up    | 2018-04-10T07:47: |
|    | consoleauth     | install         |          |         |       | 43.000000         |
|  5 | nova-scheduler  | openstack-      | internal | enabled | up    | 2018-04-10T07:47: |
|    |                 | install         |          |         |       | 42.000000         |
|  6 | nova-conductor  | openstack-      | internal | enabled | up    | 2018-04-10T07:47: |
|    |                 | install         |          |         |       | 38.000000         |
|  7 | nova-compute    | openstack-      | nova     | enabled | up    | 2018-04-10T07:47: |
|    |                 | install         |          |         |       | 39.000000         |
+----+-----------------+-----------------+----------+---------+-------+-------------------+
[root@openstack-Teguht ~(keystone_admin)]#


tutorial
http://www.tuxfixer.com/install-openstack-newton-all-in-one-with-heat-orchestration-service-on-centos-7/


.::: Setting NFS Server & NFS Client on Centos7 to Connect Network Share :::.

$
0
0
Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a computer network much like local storage is accessed. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (ONC RPC) system. The NFS is an open standard defined in Request for Comments (RFC), allowing anyone to implement the protocol.

A. Server (example 10.10.10.10 & /home/mounting)

1. Install Package
# yum install nfs* rcpbind

2. Allow firewall port/service
# firewall-cmd --permanent --add-service=rpc-bind
# firewall-cmd --permanent --add-service=nfs
# firewall-cmd --permanent --add-service=mountd
# firewall-cmd --complete-reload

3. Enable nfs service
# systemctl start nfs-server
# systemctl enable nfs
   
# systemctl start nfs-lock
# systemctl start nfs-idmap

# systemctl start rpcbind
# systemctl status rpcbind
# systemctl enable rpcbind

4. Create Folder/directory sharing
# mkdir /home/mounting
# chmod -R 777 /home/mounting

5. export directory server
vi /etc/exports
/home/mounting 10.10.10.0/24 *(rw,sync)

[root@teguht-server mounting]# cat /etc/exports
/home/mounting 10.10.10.0/24 *(rw,sync)
[root@teguht-server mounting]#

6. exportfs
# systemctl enable rpcbind
# systemctl restart rpcbind
# showmount -e
# exportfs -a
# mount -a

B. Client (example 10.10.10.20 & /mnt)
1. Install Package
# yum -y install nfs-utils

2. Allow firewall port/service
# firewall-cmd --permanent -add-service=rpc-bind
# firewall-cmd --permanent --add-service=nfs
# firewall-cmd --complete-reload

3. Editing fstab
    vi /etc/fstab
    teguht-server:/home/mounting /mnt nfs defaults 0 0
[root@teguht-client ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Thu Apr 19 14:40:30 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=a41f701b-7add-45d3-b881-a26b3bb35ccc /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0
#//teguht-server/shares /mnt/samba cifs creds=/root/teguh.creds 0 0
teguht-server:/home/mounting /mnt nfs defaults 0 0

[root@teguht-client ~]#

4. additional hosts
[root@teguht-client ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.20 teguht-client
10.10.10.10  teguht-server
[root@teguht-client ~]#

4. Restart nfs
# systemctl restart nfs-secure
# systemctl enable nfs-secure

5. Checking
# mount -a
# df -h

C. Testing
on server
[root@teguht-server data]# cd /home/mounting/
[root@teguht-server mounting]# cat test.txt
test
[root@teguht-server mounting]#
[root@teguht-server mounting]# vi ttttt.txt
[root@teguht-server mounting]# ls
12.txt  test.txt  ttttt.txt
[root@teguht-server mounting]#
[root@teguht-server mounting]# cat /home/mounting/ttttt.txt
ttgf
[root@teguht-server mounting]#

on client
[root@teguht-client mnt]# pwd
/mnt
[root@teguht-client mnt]# ls
12.txt  test.txt  ttttt.txt
[root@teguht-client mnt]#
[root@teguht-client mnt]# cat /mnt/ttttt.txt
ttgf
[root@teguht-client mnt]#






.::: Create Tenant (Project, User, Keypair, Network, Floating, upload Image, Flavors) & launch Instance In Openstack Using CLI :::.

$
0
0
Continue from after posting install openstack packstack on centos7. this tutorial create instance detail using CLI(Command Line Interface)

1. Create Project & User
# source keystonerc_admin
# openstack project create --description teguht-project-des teguht-project
# openstack user create --project teguht-project --password teguht --email teguh.triharto@microsoft.com teguht





2. Create Keystone for teguht<new_user> & keypair
# cp keystonerc_admin keystonerc_teguht
# cat keystonerc_teguht
unset OS_SERVICE_TOKEN
    export OS_USERNAME=teguht
    export OS_PASSWORD=teguht
    export OS_AUTH_URL=http://172.30.1.111:5000/v2.0
    export PS1='[\u@\h \W(keystone_teguht)]\$ '
   
export OS_TENANT_NAME=teguht-project
export OS_REGION_NAME=RegionOne
#

3. Create keypair
# source keystonerc_teguht
# openstack keypair create teguht-keypair > /root/teguht-keypair.pem
# chmod 600 /root/teguht-keypair.pem

4. Create security
# source keystonerc_teguht
# openstack security group create teguht-security
# openstack security group rule create --protocol tcp --dst-port 22 teguht-security
# openstack security group rule create --protocol icmp teguht-security


5. Create Private Network
# source /root/keystonerc_teguht
# openstack network create priv_net
# openstack subnet create --dhcp --subnet-range 2.2.2.0/24 --gateway 2.2.2.1 --allocation-pool start=2.2.2.10,end=2.2.2.30 --dns-nameserver 8.8.8.8 --network priv_net priv_subnet

# source /root/keystonerc_admin
# openstack network  show priv_net
# openstack network  set --share priv_net
# openstack network  show priv_net

# source /root/keystonerc_teguht



6. Create Public Network
# source /root/keystonerc_teguht
# openstack network create pub_net
# openstack subnet create --no-dhcp --subnet-range 172.30.1.0/24 --allocation-pool start=172.30.1.10,end=172.30.1.30 --dns-nameserver 172.30.2.22 --network pub_net pub_subnet

# source /root/keystonerc_admin
# openstack network show pub_net
# openstack network set --share --external pub_net
# openstack network show pub_net

# source /root/keystonerc_teguht




https://www.tuxfixer.com/openstack-how-to-manually-delete-orphaned-neutron-port/#more-1206

use neutron
delete from ports where id='a476470a-6d36-4dfc-bb57-6f53438f0aa5';
http://docs.metacloud.com/latest/user-guide/cli-deleting-network-resources/

7. Create Floating IP
# source /root/keystonerc_teguht
# openstack floating ip create pub_net
# openstack floating ip create pub_net

8. Uploading Image
# source /root/keystonerc_admin
# openstack image create --disk-format qcow2 --file cirros-0.4.0-x86_64-disk.img --public cirros-Image
or
# openstack image create --disk-format qcow2 --file cirros-0.4.0-x86_64-disk.img --public cirros-Image

9. Create Flavors
# source /root/keystonerc_admin
# openstack flavor create --id 6 --ram 1000 --disk 2 --vcpus 1 m1.testflavor

10. create instance as example 2 instance(server)
# openstack server create --nic net-id=priv_net --security-group teguht-security --image cirros-Image --flavor m1.testflavor --key-name teguht-keypair --wait teguht-custom01
# openstack server create --nic net-id=priv_net --security-group teguht-security --image cirros-Image --flavor m1.testflavor --key-name teguht-keypair --wait teguht-custom02

11. add server floating ip
# source /root/keystonerc_teguht
# openstack server add floating ip teguht-custom01 172.30.1.15
# openstack server add floating ip teguht-custom02 172.30.1.11

12. Open console Instance 1(teguht-custom01 )and test ping IP
# hostname
# ping -c1 2.2.2.11
# ping -c1 172.30.1.11
# ping -c1 2.2.2.14
# ping -c1 172.30.1.15
# ping -c1 172.30.2.24
# ping -c1 8.8.8.8


[root@openstack ~(keystone_teguht)]# ssh cirros@172.30.1.15
The authenticity of host '172.30.1.15 (172.30.1.15)' can't be established.
ECDSA key fingerprint is SHA256:zMTpSeErWRSVdHlJl936TYuMY8sUwI2yxhD6HR8SDiI.
ECDSA key fingerprint is MD5:d0:d8:77:2d:27:0f:0f:98:c8:7f:cd:d8:0e:81:46:cc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.30.1.15' (ECDSA) to the list of known hosts.
cirros@172.30.1.15's password:
$ hostname
teguht-custom01
$ ping -c1 2.2.2.11
PING 2.2.2.11 (2.2.2.11): 56 data bytes
64 bytes from 2.2.2.11: seq=0 ttl=64 time=32.071 ms

--- 2.2.2.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 32.071/32.071/32.071 ms
$ ping -c1 2.2.2.14
PING 2.2.2.14 (2.2.2.14): 56 data bytes
64 bytes from 2.2.2.14: seq=0 ttl=64 time=19.510 ms

--- 2.2.2.14 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 19.510/19.510/19.510 ms
$ ping -c1 172.30.1.11
PING 172.30.1.11 (172.30.1.11): 56 data bytes
64 bytes from 172.30.1.11: seq=0 ttl=63 time=1.728 ms

--- 172.30.1.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.728/1.728/1.728 ms
$ ping -c1 172.30.1.15
PING 172.30.1.15 (172.30.1.15): 56 data bytes
64 bytes from 172.30.1.15: seq=0 ttl=63 time=1.902 ms

--- 172.30.1.15 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.902/1.902/1.902 ms
$ ping -c1 172.30.1.24
PING 172.30.1.24 (172.30.1.24): 56 data bytes
64 bytes from 172.30.1.24: seq=0 ttl=125 time=15.278 ms

--- 172.30.1.24 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 15.278/15.278/15.278 ms
$ ping -c1 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=53 time=23.257 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 23.257/23.257/23.257 ms
$ exitConnection to 172.30.1.15 closed.
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]# 

13. Open console Instance 2(teguht-custom02 )and test ping IP
# hostname
# ping -c1 2.2.2.11
# ping -c1 172.30.1.11
# ping -c1 2.2.2.14
# ping -c1 172.30.1.15
# ping -c1 172.30.2.24
# ping -c1 8.8.8.8

[root@openstack ~(keystone_teguht)]# ssh cirros@172.30.1.11
The authenticity of host '172.30.1.11 (172.30.1.11)' can't be established.
ECDSA key fingerprint is SHA256:cTStLpL34qFr6lhsKdgQ2gnXgAmY+jVogb+cFEIGoLA.
ECDSA key fingerprint is MD5:ff:6b:71:41:ab:cc:77:88:7e:30:e4:89:84:a6:c7:e5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.30.1.11' (ECDSA) to the list of known hosts.
cirros@172.30.1.11's password:
$ hostname
teguht-custom02
$ ping -c1 2.2.2.11
PING 2.2.2.11 (2.2.2.11): 56 data bytes
64 bytes from 2.2.2.11: seq=0 ttl=64 time=65.375 ms

--- 2.2.2.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 65.375/65.375/65.375 ms
$ ping -c1 2.2.2.14
PING 2.2.2.14 (2.2.2.14): 56 data bytes
64 bytes from 2.2.2.14: seq=0 ttl=64 time=76.163 ms

--- 2.2.2.14 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 76.163/76.163/76.163 ms
$ ping -c1 172.30.1.11
PING 172.30.1.11 (172.30.1.11): 56 data bytes
64 bytes from 172.30.1.11: seq=0 ttl=63 time=87.308 ms

--- 172.30.1.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 87.308/87.308/87.308 ms
$ ping -c1 172.30.1.15
PING 172.30.1.15 (172.30.1.15): 56 data bytes
64 bytes from 172.30.1.15: seq=0 ttl=63 time=71.663 ms

--- 172.30.1.15 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 71.663/71.663/71.663 ms
$ ping -c1 172.30.1.24
PING 172.30.1.24 (172.30.1.24): 56 data bytes
64 bytes from 172.30.1.24: seq=0 ttl=125 time=44.970 ms

--- 172.30.1.24 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 44.970/44.970/44.970 ms
$ cat /etc/hosts
127.0.0.1    localhost
127.0.1.1    cirros
$ exit
Connection to 172.30.1.11 closed.
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]#

14. Check Network Topology for your project




15. Detail lab as

16. for detail log. go to Log install using CLI

.::: Log Output Create Tenant Project, User, Keypair, Network, Floating, upload Image, Flavors, Instance In Openstack Using CLI :::.

$
0
0
this post as example log output from cli to Create Tenant Project, User, Keypair, Network, Floating, upload Image, Flavors, Instance

1. Create Project & User
# source keystonerc_admin
# openstack project create --description teguht-project-des teguht-project
# openstack user create --project teguht-project --password teguht --email teguh.triharto@microsoft.com teguht
# openstack project list
# openstack project show teguht-project
# openstack user list
# openstack user show teguht
# openstack user role list

Sample Output
[root@openstack ~(keystone_admin)]# openstack project create --description teguht-project-des teguht-project
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | teguht-project-des               |
| enabled     | True                             |
| id          | 0fc7bb90bc714c8685108415557f08a2 |
| name        | teguht-project                   |
+-------------+----------------------------------+
[root@openstack ~(keystone_admin)]# openstack user create --project teguht-project --password teguht --email teguh.triharto@microsoft.com teguht
+------------+----------------------------------+
| Field      | Value                            |
+------------+----------------------------------+
| email      | teguh.triharto@microsoft.com     |
| enabled    | True                             |
| id         | 8458f9a2a29f4c5d8f4e69fc066bd300 |
| name       | teguht                           |
| project_id | 0fc7bb90bc714c8685108415557f08a2 |
| username   | teguht                           |
+------------+----------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack project list
+----------------------------------+--------------------+
| ID                               | Name               |
+----------------------------------+--------------------+
| 0fc7bb90bc714c8685108415557f08a2 | teguht-project     |
| 2d47b0d4fc8143e78185bd9a33957cc1 | admin              |
| 658ffaee6d874a0680f0195093ac6296 | services           |
| 6ad5013192724fd78007140ac2a2579b | amran              |
| 7ba259f26c1a42eebb0295b613d5e804 | aisyah_zahra_amran |
+----------------------------------+--------------------+
[root@openstack ~(keystone_admin)]#

[root@openstack ~(keystone_admin)]# openstack project show teguht-project
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | teguht-project-des               |
| enabled     | True                             |
| id          | 0fc7bb90bc714c8685108415557f08a2 |
| name        | teguht-project                   |
| properties  |                                  |
+-------------+----------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack user list
+----------------------------------+-----------------+
| ID                               | Name            |
+----------------------------------+-----------------+
| 1886ff9891d8427ab570770ec729e450 | heat-cfn        |
| 3994ac2b00b846358293b8adfad838cd | aodh            |
| 454fa25ce801470694d6df44c783fd77 | neutron         |
| 66b3b6c8bbee47cda9570d3cc8d2e200 | amran           |
| 76bdad354e3342fb8dd84e2a6c4cd49d | gnocchi         |
| 77807459de3340e7b1ce2bff59a6fd49 | heat            |
| 7fce5441197142c5ad923a81cfdaa608 | admin           |
| 8458f9a2a29f4c5d8f4e69fc066bd300 | teguht          |
| 9e33dbea0c1945aca15040e2ac206959 | glance          |
| a5c80a6b60064ce7a934d12d54de347a | teguht.triharto |
| c2647dae9a9e49e7a79dcd9ff6d88911 | ceilometer      |
| d1682ecdd3f549b78aea3765e89083d3 | nova            |
| d236785523024be1b482ab56ace72fca | cinder          |
| d8bce13abad84c7583435d58f342fde1 | swift           |
+----------------------------------+-----------------+
[root@openstack ~(keystone_admin)]# openstack user show teguht
+------------+----------------------------------+
| Field      | Value                            |
+------------+----------------------------------+
| email      | teguh.triharto@microsoft.com     |
| enabled    | True                             |
| id         | 8458f9a2a29f4c5d8f4e69fc066bd300 |
| name       | teguht                           |
| project_id | 0fc7bb90bc714c8685108415557f08a2 |
| username   | teguht                           |
+------------+----------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack user role list
Listing assignments using user role list is deprecated as of the Newton release. Use role assignment list --user <user-name> --project <project-name> --names instead.
+----------------------------------+------------------+---------+-------+
| ID                               | Name             | Project | User  |
+----------------------------------+------------------+---------+-------+
| 8d6b80ba317741ec993e1ef638584ecb | heat_stack_owner | admin   | admin |
| 9fe2ff9ee4384b1894a90878d3e92bab | _member_         | admin   | admin |
| b074a01883a44d6286feb547599f3d58 | admin            | admin   | admin |
+----------------------------------+------------------+---------+-------+
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_admin)]#

2. Create Keystone for teguht<new_user> & keypair
# cp keystonerc_admin keystonerc_teguht
# cat keystonerc_teguht
unset OS_SERVICE_TOKEN
    export OS_USERNAME=teguht
    export OS_PASSWORD=teguht
    export OS_AUTH_URL=http://172.30.1.111:5000/v2.0
    export PS1='[\u@\h \W(keystone_teguht)]\$ '
  
export OS_TENANT_NAME=teguht-project
export OS_REGION_NAME=RegionOne
#

sample output
[root@openstack ~(keystone_admin)]# cat /root/keystonerc_teguht
unset OS_SERVICE_TOKEN
    export OS_USERNAME=teguht
#    export OS_PASSWORD=1d0c29fb2f9a4a6f
export OS_PASSWORD=teguht
    export OS_AUTH_URL=http://172.30.1.111:5000/v2.0
    export PS1='[\u@\h \W(keystone_teguht)]\$ '
   
export OS_TENANT_NAME=teguht-project
export OS_REGION_NAME=RegionOne
   
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_admin)]#

3. Create keypair
# source keystonerc_teguht
# openstack keypair create teguht-keypair > /root/teguht-keypair.pem
# chmod 600 /root/teguht-keypair.pem
# openstack keypair list
# openstack keypair show teguht-keypair

sample
[root@openstack ~(keystone_teguht)]# openstack keypair create teguht-keypair > /root/teguht-keypair.pem
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# chmod 600 /root/teguht-keypair.pem
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack keypair list
+----------------+-------------------------------------------------+
| Name           | Fingerprint                                     |
+----------------+-------------------------------------------------+
| teguht-keypair | 17:64:0f:4d:de:d8:9f:2c:a1:0a:ec:20:94:81:be:5c |
+----------------+-------------------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack keypair show teguht-keypair
+-------------+-------------------------------------------------+
| Field       | Value                                           |
+-------------+-------------------------------------------------+
| created_at  | 2018-05-09T08:37:48.000000                      |
| deleted     | False                                           |
| deleted_at  | None                                            |
| fingerprint | 17:64:0f:4d:de:d8:9f:2c:a1:0a:ec:20:94:81:be:5c |
| id          | 2                                               |
| name        | teguht-keypair                                  |
| updated_at  | None                                            |
| user_id     | 8458f9a2a29f4c5d8f4e69fc066bd300                |
+-------------+-------------------------------------------------+
[root@openstack ~(keystone_teguht)]#

4. Create security
# source keystonerc_teguht
# openstack security group create teguht-security
# openstack security group rule create --protocol tcp --dst-port 22 teguht-security
# openstack security group rule create --protocol icmp teguht-security
# openstack security group list
# openstack security group show teguht-security

sample
[root@openstack ~(keystone_teguht)]# openstack security group create teguht-security
+-----------------+--------------------------------------------------------------------------------------------------+
| Field           | Value                                                                                            |
+-----------------+--------------------------------------------------------------------------------------------------+
| created_at      | 2018-05-09T08:39:02Z                                                                             |
| description     | teguht-security                                                                                  |
| headers         |                                                                                                  |
| id              | bfa10545-e467-4da4-9049-647674464934                                                             |
| name            | teguht-security                                                                                  |
| project_id      | 0fc7bb90bc714c8685108415557f08a2                                                                 |
| project_id      | 0fc7bb90bc714c8685108415557f08a2                                                                 |
| revision_number | 1                                                                                                |
| rules           | created_at='2018-05-09T08:39:02Z', direction='egress', ethertype='IPv4', id='e37eeb5a-053c-476d- |
|                 | affa-167afa608ebc', project_id='0fc7bb90bc714c8685108415557f08a2', revision_number='1',          |
|                 | updated_at='2018-05-09T08:39:02Z'                                                                |
|                 | created_at='2018-05-09T08:39:02Z', direction='egress', ethertype='IPv6', id='55fdf821-3978-425f- |
|                 | 9ace-ae2236e45be0', project_id='0fc7bb90bc714c8685108415557f08a2', revision_number='1',          |
|                 | updated_at='2018-05-09T08:39:02Z'                                                                |
| updated_at      | 2018-05-09T08:39:02Z                                                                             |
+-----------------+--------------------------------------------------------------------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack security group rule create --protocol tcp --dst-port 22 teguht-security
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| created_at        | 2018-05-09T08:39:04Z                 |
| description       |                                      |
| direction         | ingress                              |
| ethertype         | IPv4                                 |
| headers           |                                      |
| id                | 559d6a48-942f-4d40-8e65-665a7ef14c5c |
| port_range_max    | 22                                   |
| port_range_min    | 22                                   |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| protocol          | tcp                                  |
| remote_group_id   | None                                 |
| remote_ip_prefix  | 0.0.0.0/0                            |
| revision_number   | 1                                    |
| security_group_id | bfa10545-e467-4da4-9049-647674464934 |
| updated_at        | 2018-05-09T08:39:04Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack security group rule create --protocol icmp teguht-security
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| created_at        | 2018-05-09T08:39:05Z                 |
| description       |                                      |
| direction         | ingress                              |
| ethertype         | IPv4                                 |
| headers           |                                      |
| id                | e7c63c67-4a37-4ada-8915-73a7d69c7836 |
| port_range_max    | None                                 |
| port_range_min    | None                                 |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| protocol          | icmp                                 |
| remote_group_id   | None                                 |
| remote_ip_prefix  | 0.0.0.0/0                            |
| revision_number   | 1                                    |
| security_group_id | bfa10545-e467-4da4-9049-647674464934 |
| updated_at        | 2018-05-09T08:39:05Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack security group list
+--------------------------------------+-----------------+------------------------+----------------------------------+
| ID                                   | Name            | Description            | Project                          |
+--------------------------------------+-----------------+------------------------+----------------------------------+
| 71814f2e-d10e-4db5-bd65-ba70fe014ee9 | default         | Default security group | 0fc7bb90bc714c8685108415557f08a2 |
| bfa10545-e467-4da4-9049-647674464934 | teguht-security | teguht-security        | 0fc7bb90bc714c8685108415557f08a2 |
+--------------------------------------+-----------------+------------------------+----------------------------------+
[root@openstack ~(keystone_teguht)]# openstack security group show teguht-security
+-----------------+--------------------------------------------------------------------------------------------------+
| Field           | Value                                                                                            |
+-----------------+--------------------------------------------------------------------------------------------------+
| created_at      | 2018-05-09T08:39:02Z                                                                             |
| description     | teguht-security                                                                                  |
| id              | bfa10545-e467-4da4-9049-647674464934                                                             |
| name            | teguht-security                                                                                  |
| project_id      | 0fc7bb90bc714c8685108415557f08a2                                                                 |
| project_id      | 0fc7bb90bc714c8685108415557f08a2                                                                 |
| revision_number | 3                                                                                                |
| rules           | created_at='2018-05-09T08:39:04Z', direction='ingress', ethertype='IPv4', id='559d6a48-942f-     |
|                 | 4d40-8e65-665a7ef14c5c', port_range_max='22', port_range_min='22',                               |
|                 | project_id='0fc7bb90bc714c8685108415557f08a2', protocol='tcp', remote_ip_prefix='0.0.0.0/0',     |
|                 | revision_number='1', updated_at='2018-05-09T08:39:04Z'                                           |
|                 | created_at='2018-05-09T08:39:02Z', direction='egress', ethertype='IPv6', id='55fdf821-3978-425f- |
|                 | 9ace-ae2236e45be0', project_id='0fc7bb90bc714c8685108415557f08a2', revision_number='1',          |
|                 | updated_at='2018-05-09T08:39:02Z'                                                                |
|                 | created_at='2018-05-09T08:39:02Z', direction='egress', ethertype='IPv4', id='e37eeb5a-053c-476d- |
|                 | affa-167afa608ebc', project_id='0fc7bb90bc714c8685108415557f08a2', revision_number='1',          |
|                 | updated_at='2018-05-09T08:39:02Z'                                                                |
|                 | created_at='2018-05-09T08:39:05Z', direction='ingress', ethertype='IPv4',                        |
|                 | id='e7c63c67-4a37-4ada-8915-73a7d69c7836', project_id='0fc7bb90bc714c8685108415557f08a2',        |
|                 | protocol='icmp', remote_ip_prefix='0.0.0.0/0', revision_number='1',                              |
|                 | updated_at='2018-05-09T08:39:05Z'                                                                |
| updated_at      | 2018-05-09T08:39:05Z                                                                             |
+-----------------+--------------------------------------------------------------------------------------------------+
[root@openstack ~(keystone_teguht)]#

5. Create Private Network
# source /root/keystonerc_teguht
# openstack network create priv_net
# openstack subnet create --dhcp --subnet-range 2.2.2.0/24 --gateway 2.2.2.1 --allocation-pool start=2.2.2.10,end=2.2.2.30 --dns-nameserver 8.8.8.8 --network priv_net priv_subnet

# source /root/keystonerc_admin
# openstack network  show priv_net
# openstack network  set --share priv_net
# openstack network  show priv_net

# source /root/keystonerc_teguht
# openstack network list
# openstack network show priv_net
# openstack subnet list
# openstack subnet show priv_subnet

sample output
[root@openstack ~(keystone_teguht)]# openstack network create priv_net
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2018-05-09T08:58:09Z                 |
| description             |                                      |
| headers                 |                                      |
| id                      | 5ec5af36-15db-42d1-b016-cb18c655ad8f |
| ipv4_address_scope      | None                                 |
| ipv6_address_scope      | None                                 |
| mtu                     | 1450                                 |
| name                    | priv_net                             |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 2                                    |
| router:external         | Internal                             |
| shared                  | False                                |
| status                  | ACTIVE                               |
| subnets                 |                                      |
| tags                    | []                                   |
| updated_at              | 2018-05-09T08:58:09Z                 |
+-------------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack subnet create --dhcp --subnet-range 2.2.2.0/24 --gateway 2.2.2.1 --allocation-pool start=2.2.2.10,end=2.2.2.30 --dns-nameserver 8.8.8.8 --network priv_net priv_subnet
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| allocation_pools  | 2.2.2.10-2.2.2.30                    |
| cidr              | 2.2.2.0/24                           |
| created_at        | 2018-05-09T08:58:13Z                 |
| description       |                                      |
| dns_nameservers   | 8.8.8.8                              |
| enable_dhcp       | True                                 |
| gateway_ip        | 2.2.2.1                              |
| headers           |                                      |
| host_routes       |                                      |
| id                | bc9b485d-297d-4f1c-bc2b-9bf984581358 |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | priv_subnet                          |
| network_id        | 5ec5af36-15db-42d1-b016-cb18c655ad8f |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2018-05-09T08:58:13Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_admin)]# openstack network  show priv_net
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2018-05-09T09:07:53Z                 |
| description               |                                      |
| id                        | 6ad3e3bf-9b80-426e-8db6-251944763e62 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1450                                 |
| name                      | priv_net                             |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 99                                   |
| revision_number           | 5                                    |
| router:external           | Internal                             |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | 547b6765-4091-465e-83d0-7ac092085dfe |
| tags                      | []                                   |
| updated_at                | 2018-05-09T09:27:33Z                 |
+---------------------------+--------------------------------------+
[root@openstack ~(keystone_admin)]# openstack network  set --share priv_net
[root@openstack ~(keystone_admin)]# openstack network  show priv_net
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2018-05-09T09:07:53Z                 |
| description               |                                      |
| id                        | 6ad3e3bf-9b80-426e-8db6-251944763e62 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1450                                 |
| name                      | priv_net                             |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 99                                   |
| revision_number           | 6                                    |
| router:external           | Internal                             |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   | 547b6765-4091-465e-83d0-7ac092085dfe |
| tags                      | []                                   |
| updated_at                | 2018-05-09T09:28:59Z                 |
+---------------------------+--------------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_teguht)]# openstack network list
+--------------------------------------+----------+--------------------------------------+
| ID                                   | Name     | Subnets                              |
+--------------------------------------+----------+--------------------------------------+
| ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 | pub_net  | 310079a9-5978-4607-aede-8484a5031e98 |
| ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c | priv_net | e4bf0054-c34e-453e-b027-0cdcd20aad9a |
+--------------------------------------+----------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack network show priv_net
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      | nova                                 |
| created_at              | 2018-05-11T09:48:20Z                 |
| description             |                                      |
| id                      | ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c |
| ipv4_address_scope      | None                                 |
| ipv6_address_scope      | None                                 |
| mtu                     | 1450                                 |
| name                    | priv_net                             |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 5                                    |
| router:external         | Internal                             |
| shared                  | True                                 |
| status                  | ACTIVE                               |
| subnets                 | e4bf0054-c34e-453e-b027-0cdcd20aad9a |
| tags                    | []                                   |
| updated_at              | 2018-05-11T09:48:26Z                 |
+-------------------------+--------------------------------------+
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack subnet list
+--------------------------------------+-------------+--------------------------------------+----------------+
| ID                                   | Name        | Network                              | Subnet         |
+--------------------------------------+-------------+--------------------------------------+----------------+
| 310079a9-5978-4607-aede-8484a5031e98 | pub_subnet  | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 | 172.30.1.0/24 |
| e4bf0054-c34e-453e-b027-0cdcd20aad9a | priv_subnet | ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c | 2.2.2.0/24     |
+--------------------------------------+-------------+--------------------------------------+----------------+
[root@openstack ~(keystone_teguht)]# openstack subnet show priv_subnet
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| allocation_pools  | 2.2.2.10-2.2.2.30                    |
| cidr              | 2.2.2.0/24                           |
| created_at        | 2018-05-11T09:48:22Z                 |
| description       |                                      |
| dns_nameservers   | 8.8.8.8                              |
| enable_dhcp       | True                                 |
| gateway_ip        | 2.2.2.1                              |
| host_routes       |                                      |
| id                | e4bf0054-c34e-453e-b027-0cdcd20aad9a |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | priv_subnet                          |
| network_id        | ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2018-05-11T09:48:22Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#

6. Create Public Network
# source /root/keystonerc_teguht
# openstack network create pub_net
# openstack subnet create --no-dhcp --subnet-range 172.30.1.0/24 --allocation-pool start=172.30.1.10,end=172.30.1.30 --dns-nameserver 172.30.2.22 --network pub_net pub_subnet

# source /root/keystonerc_admin
# openstack network show pub_net
# openstack network set --share --external pub_net
# openstack network show pub_net

# source /root/keystonerc_teguht
# openstack network show pub_net
# openstack subnet list
# openstack subnet show pub_subnet

sample
[root@openstack ~(keystone_teguht)]# openstack network create pub_net
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2018-05-09T09:30:29Z                 |
| description             |                                      |
| headers                 |                                      |
| id                      | cf15f57b-d82b-458d-be26-f454f7054366 |
| ipv4_address_scope      | None                                 |
| ipv6_address_scope      | None                                 |
| mtu                     | 1450                                 |
| name                    | pub_net                              |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 2                                    |
| router:external         | Internal                             |
| shared                  | False                                |
| status                  | ACTIVE                               |
| subnets                 |                                      |
| tags                    | []                                   |
| updated_at              | 2018-05-09T09:30:29Z                 |
+-------------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack subnet create --no-dhcp --subnet-range 172.30.1.0/24 --allocation-pool start=172.30.1.10,end=172.30.1.30 --dns-nameserver 172.30.2.54 --network pub_net pub_subnet
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| allocation_pools  | 172.30.1.10-172.30.1.30            |
| cidr              | 172.30.1.0/24                       |
| created_at        | 2018-05-09T09:30:31Z                 |
| description       |                                      |
| dns_nameservers   | 172.30.2.54                        |
| enable_dhcp       | False                                |
| gateway_ip        | 172.30.1.1                          |
| headers           |                                      |
| host_routes       |                                      |
| id                | df6e1586-0a65-4a62-a80f-84fada709ab5 |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | pub_subnet                           |
| network_id        | cf15f57b-d82b-458d-be26-f454f7054366 |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2018-05-09T09:30:31Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#

[root@openstack ~(keystone_admin)]# openstack network show pub_net
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2018-05-09T09:30:29Z                 |
| description               |                                      |
| id                        | cf15f57b-d82b-458d-be26-f454f7054366 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1450                                 |
| name                      | pub_net                              |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 97                                   |
| revision_number           | 4                                    |
| router:external           | Internal                             |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | df6e1586-0a65-4a62-a80f-84fada709ab5 |
| tags                      | []                                   |
| updated_at                | 2018-05-09T09:30:31Z                 |
+---------------------------+--------------------------------------+
[root@openstack ~(keystone_admin)]# openstack network set --share --external pub_net
[root@openstack ~(keystone_admin)]# openstack network show pub_net
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2018-05-09T09:30:29Z                 |
| description               |                                      |
| id                        | cf15f57b-d82b-458d-be26-f454f7054366 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| is_default                | False                                |
| mtu                       | 1450                                 |
| name                      | pub_net                              |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| project_id                | 0fc7bb90bc714c8685108415557f08a2     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 97                                   |
| revision_number           | 6                                    |
| router:external           | External                             |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   | df6e1586-0a65-4a62-a80f-84fada709ab5 |
| tags                      | []                                   |
| updated_at                | 2018-05-09T10:12:34Z                 |
+---------------------------+--------------------------------------+
[root@openstack ~(keystone_admin)]#

[root@openstack ~(keystone_teguht)]# openstack network list
+--------------------------------------+----------+--------------------------------------+
| ID                                   | Name     | Subnets                              |
+--------------------------------------+----------+--------------------------------------+
| ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 | pub_net  | 310079a9-5978-4607-aede-8484a5031e98 |
| ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c | priv_net | e4bf0054-c34e-453e-b027-0cdcd20aad9a |
+--------------------------------------+----------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack network show pub_net
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      | nova                                 |
| created_at              | 2018-05-11T09:48:30Z                 |
| description             |                                      |
| id                      | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| ipv4_address_scope      | None                                 |
| ipv6_address_scope      | None                                 |
| is_default              | False                                |
| mtu                     | 1450                                 |
| name                    | pub_net                              |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 6                                    |
| router:external         | External                             |
| shared                  | True                                 |
| status                  | ACTIVE                               |
| subnets                 | 310079a9-5978-4607-aede-8484a5031e98 |
| tags                    | []                                   |
| updated_at              | 2018-05-11T09:48:37Z                 |
+-------------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack subnet list
+--------------------------------------+-------------+--------------------------------------+----------------+
| ID                                   | Name        | Network                              | Subnet         |
+--------------------------------------+-------------+--------------------------------------+----------------+
| 310079a9-5978-4607-aede-8484a5031e98 | pub_subnet  | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 | 172.30.1.0/24 |
| e4bf0054-c34e-453e-b027-0cdcd20aad9a | priv_subnet | ea7d0d1e-11ef-4116-a8f5-29f51e4e5d9c | 2.2.2.0/24     |
+--------------------------------------+-------------+--------------------------------------+----------------+
[root@openstack ~(keystone_teguht)]# openstack subnet show pub_subnet
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| allocation_pools  | 172.30.1.10-172.30.1.30            |
| cidr              | 172.30.1.0/24                       |
| created_at        | 2018-05-11T09:48:33Z                 |
| description       |                                      |
| dns_nameservers   | 172.30.2.54                        |
| enable_dhcp       | False                                |
| gateway_ip        | 172.30.1.1                          |
| host_routes       |                                      |
| id                | 310079a9-5978-4607-aede-8484a5031e98 |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | pub_subnet                           |
| network_id        | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| project_id        | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2018-05-11T09:48:33Z                 |
+-------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#


https://www.tuxfixer.com/openstack-how-to-manually-delete-orphaned-neutron-port/#more-1206

use neutron
delete from ports where id='a476470a-6d36-4dfc-bb57-6f53438f0aa5';
http://docs.metacloud.com/latest/user-guide/cli-deleting-network-resources/

7. Create Router

# source /root/keystonerc_teguht
# openstack router create router-teguht
# neutron router-gateway-set router-teguht pub_net
# openstack router add subnet router-teguht priv_subnet
# openstack router list
# openstack router show router-teguht
# neutron port-list

sample
[root@openstack ~(keystone_teguht)]# openstack router create router-teguht
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2018-05-09T10:24:25Z                 |
| description             |                                      |
| external_gateway_info   | null                                 |
| flavor_id               | None                                 |
| headers                 |                                      |
| id                      | d7af2b1b-eb83-4685-8ecd-0238a395be3f |
| name                    | router-teguht                        |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| project_id              | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number         | 3                                    |
| routes                  |                                      |
| status                  | ACTIVE                               |
| updated_at              | 2018-05-09T10:24:25Z                 |
+-------------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# neutron router-gateway-set router-teguht pub_net
Set gateway for router router-teguht
[root@openstack ~(keystone_teguht)]# openstack router add subnet router-teguht priv_subnet
HttpException: Bad Request
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack router list
+-------------------------------+---------------+--------+-------+-------------+----+--------------------------------+
| ID                            | Name          | Status | State | Distributed | HA | Project                        |
+-------------------------------+---------------+--------+-------+-------------+----+--------------------------------+
| fd4d9360-b1c0-46ce-b379-f0be7 | router-teguht | ACTIVE | UP    |             |    | 0fc7bb90bc714c8685108415557f08 |
| fe35aa3                       |               |        |       |             |    | a2                             |
+-------------------------------+---------------+--------+-------+-------------+----+--------------------------------+
[root@openstack ~(keystone_teguht)]# openstack router show router-teguht
+-------------------------+------------------------------------------------------------------------------------------+
| Field                   | Value                                                                                    |
+-------------------------+------------------------------------------------------------------------------------------+
| admin_state_up          | UP                                                                                       |
| availability_zone_hints |                                                                                          |
| availability_zones      | nova                                                                                     |
| created_at              | 2018-05-11T09:48:41Z                                                                     |
| description             |                                                                                          |
| external_gateway_info   | {"network_id": "ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3", "enable_snat": true,              |
|                         | "external_fixed_ips": [{"subnet_id": "310079a9-5978-4607-aede-8484a5031e98",             |
|                         | "ip_address": "172.30.1.12"}]}                                                          |
| flavor_id               | None                                                                                     |
| id                      | fd4d9360-b1c0-46ce-b379-f0be7fe35aa3                                                     |
| name                    | router-teguht                                                                            |
| project_id              | 0fc7bb90bc714c8685108415557f08a2                                                         |
| project_id              | 0fc7bb90bc714c8685108415557f08a2                                                         |
| revision_number         | 7                                                                                        |
| routes                  |                                                                                          |
| status                  | ACTIVE                                                                                   |
| updated_at              | 2018-05-11T09:48:49Z                                                                     |
+-------------------------+------------------------------------------------------------------------------------------+
[root@openstack ~(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# neutron port-list
+--------------------------------------+------+-------------------+--------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                  |
+--------------------------------------+------+-------------------+--------------------------------------------+
| 59587023-06b7-440f-b53e-8b1b1dcb00e1 |      | fa:16:3e:df:c0:d4 | {"subnet_id": "310079a9-5978-4607-aede-    |
|                                      |      |                   | 8484a5031e98", "ip_address":               |
|                                      |      |                   | "172.30.1.11"}                            |
| 633378a2-0a31-4837-bf00-fa0bd510087e |      | fa:16:3e:5f:23:a3 | {"subnet_id": "310079a9-5978-4607-aede-    |
|                                      |      |                   | 8484a5031e98", "ip_address":               |
|                                      |      |                   | "172.30.1.12"}                            |
| 7246722d-5222-4fa1-b270-2de635a979fa |      | fa:16:3e:c8:e9:27 | {"subnet_id": "e4bf0054-c34e-              |
|                                      |      |                   | 453e-b027-0cdcd20aad9a", "ip_address":     |
|                                      |      |                   | "2.2.2.11"}                                |
| 756bfdd5-449f-42c2-9329-df3874bf1671 |      | fa:16:3e:5a:73:d5 | {"subnet_id": "e4bf0054-c34e-              |
|                                      |      |                   | 453e-b027-0cdcd20aad9a", "ip_address":     |
|                                      |      |                   | "2.2.2.1"}                                 |
| a0d74203-5f50-41de-9bcf-018b29896951 |      | fa:16:3e:2a:bc:e8 | {"subnet_id": "310079a9-5978-4607-aede-    |
|                                      |      |                   | 8484a5031e98", "ip_address":               |
|                                      |      |                   | "172.30.1.13"}                            |
| c91c8b9e-813f-4c08-99c3-e5b94c58901f |      | fa:16:3e:48:57:8b | {"subnet_id": "e4bf0054-c34e-              |
|                                      |      |                   | 453e-b027-0cdcd20aad9a", "ip_address":     |
|                                      |      |                   | "2.2.2.10"}                                |
| d9efb3df-5b38-4d8a-a463-cb9b38166d73 |      | fa:16:3e:15:68:c3 | {"subnet_id": "310079a9-5978-4607-aede-    |
|                                      |      |                   | 8484a5031e98", "ip_address":               |
|                                      |      |                   | "172.30.1.15"}                            |
| f5f345fc-13f6-40df-9499-7a5a0f6d27ed |      | fa:16:3e:1b:f3:30 | {"subnet_id": "e4bf0054-c34e-              |
|                                      |      |                   | 453e-b027-0cdcd20aad9a", "ip_address":     |
|                                      |      |                   | "2.2.2.14"}                                |
+--------------------------------------+------+-------------------+--------------------------------------------+
[root@openstack ~(keystone_teguht)]#

8. Create Floating IP
# source /root/keystonerc_teguht
# openstack floating ip create pub_net
# openstack floating ip create pub_net
# openstack floating ip list
# openstack floating ip show 172.30.1.11
# openstack floating ip show 172.30.1.15

sample
[root@openstack data(keystone_teguht)]# openstack floating ip create pub_net
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2018-05-14T10:34:21Z                 |
| description         |                                      |
| fixed_ip_address    | None                                 |
| floating_ip_address | 172.30.1.11                         |
| floating_network_id | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| headers             |                                      |
| id                  | 8c73913a-4f5b-43c4-8eff-068021cc07f9 |
| port_id             | None                                 |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number     | 1                                    |
| router_id           | None                                 |
| status              | DOWN                                 |
| updated_at          | 2018-05-14T10:34:21Z                 |
+---------------------+--------------------------------------+
[root@openstack data(keystone_teguht)]#
[root@openstack data(keystone_teguht)]# openstack floating ip create pub_net
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2018-05-14T10:34:21Z                 |
| description         |                                      |
| fixed_ip_address    | None                                 |
| floating_ip_address | 172.30.1.15                         |
| floating_network_id | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| headers             |                                      |
| id                  | dfbfe3e1-ec26-4607-b3b8-44c4f66d9c98 |
| port_id             | None                                 |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number     | 1                                    |
| router_id           | None                                 |
| status              | DOWN                                 |
| updated_at          | 2018-05-14T10:34:21Z                 |
+---------------------+--------------------------------------+
[root@openstack data(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack floating ip list
+-------------------------------------+---------------------+------------------+-------------------------------------+
| ID                                  | Floating IP Address | Fixed IP Address | Port                                |
+-------------------------------------+---------------------+------------------+-------------------------------------+
| 8c73913a-4f5b-43c4-8eff-            | 172.30.1.11        | 2.2.2.11         | 7246722d-5222-4fa1-b270-2de635a979f |
| 068021cc07f9                        |                     |                  | a                                   |
| 9e54db9f-9b4d-                      | 172.30.1.13        | None             | None                                |
| 4c05-82b4-2e56d2f724e7              |                     |                  |                                     |
| dfbfe3e1-ec26-4607-b3b8-44c4f66d9c9 | 172.30.1.15        | 2.2.2.14         | f5f345fc-                           |
| 8                                   |                     |                  | 13f6-40df-9499-7a5a0f6d27ed         |
+-------------------------------------+---------------------+------------------+-------------------------------------+
You have mail in /var/spool/mail/root

[root@openstack ~(keystone_teguht)]# openstack floating ip show 172.30.1.15
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2018-05-14T10:34:21Z                 |
| description         |                                      |
| fixed_ip_address    | 2.2.2.14                             |
| floating_ip_address | 172.30.1.15                         |
| floating_network_id | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| id                  | dfbfe3e1-ec26-4607-b3b8-44c4f66d9c98 |
| port_id             | f5f345fc-13f6-40df-9499-7a5a0f6d27ed |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number     | 6                                    |
| router_id           | fd4d9360-b1c0-46ce-b379-f0be7fe35aa3 |
| status              | ACTIVE                               |
| updated_at          | 2018-05-15T20:01:14Z                 |
+---------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack floating ip show 172.30.1.11
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2018-05-11T09:50:33Z                 |
| description         |                                      |
| fixed_ip_address    | 2.2.2.11                             |
| floating_ip_address | 172.30.1.11                         |
| floating_network_id | ce2df5d5-bde9-4ac3-9dc0-a575f71de7c3 |
| id                  | 8c73913a-4f5b-43c4-8eff-068021cc07f9 |
| port_id             | 7246722d-5222-4fa1-b270-2de635a979fa |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| project_id          | 0fc7bb90bc714c8685108415557f08a2     |
| revision_number     | 10                                   |
| router_id           | fd4d9360-b1c0-46ce-b379-f0be7fe35aa3 |
| status              | ACTIVE                               |
| updated_at          | 2018-05-15T20:01:19Z                 |
+---------------------+--------------------------------------+
[root@openstack ~(keystone_teguht)]#

9. Uploading Image
# source /root/keystonerc_admin
# openstack image create --disk-format qcow2 --file cirros-0.4.0-x86_64-disk.img --public cirros-Image
or
# openstack image create --disk-format qcow2 --file /data/cirros-0.4.0-x86_64-disk.img --public cirros-Image
# openstack image list
# openstack image show cirros-Image

sample
[root@openstack data(keystone_admin)]# openstack image create --disk-format qcow2 --file cirros-0.4.0-x86_64-disk.img --public cirros-Image
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-05-14T10:29:28Z                                 |
| disk_format      | iso                                                  |
| file             | /v2/images/c92c2545-d1e1-4c91-bfb6-6d06b895063a/file |
| id               | c92c2545-d1e1-4c91-bfb6-6d06b895063a                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-Image                                         |
| owner            | 2d47b0d4fc8143e78185bd9a33957cc1                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-05-14T10:29:29Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
You have mail in /var/spool/mail/root
[root@openstack data(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack image create --disk-format qcow2 --file /data/cirros-0.4.0-x86_64-disk.img --public cirros-Image-test
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-05-17T03:20:46Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/3217b568-9740-4520-b807-42f44091f06d/file |
| id               | 3217b568-9740-4520-b807-42f44091f06d                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-Image-test                                    |
| owner            | 2d47b0d4fc8143e78185bd9a33957cc1                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-05-17T03:20:46Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# openstack image list
+--------------------------------------+-------------------+--------+
| ID                                   | Name              | Status |
+--------------------------------------+-------------------+--------+
| 3217b568-9740-4520-b807-42f44091f06d | cirros-Image-test | active |
| 7bfa53ea-fe39-4d44-860a-b6495a5f24fc | cirros-Image      | active |
| 5acafbde-4493-4f00-acfa-18876453179e | xp3               | active |
| de680b57-f616-47e9-99f2-b5ed6dbf0e23 | Cirrus_ori        | active |
+--------------------------------------+-------------------+--------+
[root@openstack ~(keystone_admin)]# openstack image show cirros-Image
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-05-14T10:38:51Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/7bfa53ea-fe39-4d44-860a-b6495a5f24fc/file |
| id               | 7bfa53ea-fe39-4d44-860a-b6495a5f24fc                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-Image                                         |
| owner            | 2d47b0d4fc8143e78185bd9a33957cc1                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-05-14T10:38:51Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
[root@openstack ~(keystone_admin)]# openstack image show cirros-Image-test
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-05-17T03:20:46Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/3217b568-9740-4520-b807-42f44091f06d/file |
| id               | 3217b568-9740-4520-b807-42f44091f06d                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-Image-test                                    |
| owner            | 2d47b0d4fc8143e78185bd9a33957cc1                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-05-17T03:20:46Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
[root@openstack ~(keystone_admin)]#

10. Create Flavors
# source /root/keystonerc_admin
# openstack flavor create --id 6 --ram 1000 --disk 2 --vcpus 1 m1.testflavor
# openstack flavor list
# openstack flavor show m1.testflavor

sample
[root@openstack ~(keystone_admin)]# openstack flavor create --id 6 --ram 1000 --disk 2 --vcpus 1 m1.testflavor
+----------------------------+---------------+
| Field                      | Value         |
+----------------------------+---------------+
| OS-FLV-DISABLED:disabled   | False         |
| OS-FLV-EXT-DATA:ephemeral  | 0             |
| disk                       | 2             |
| id                         | 6             |
| name                       | m1.testflavor |
| os-flavor-access:is_public | True          |
| properties                 |               |
| ram                        | 1000          |
| rxtx_factor                | 1.0           |
| swap                       |               |
| vcpus                      | 1             |
+----------------------------+---------------+
[root@openstack ~(keystone_admin)]#

[root@openstack ~(keystone_teguht)]# openstack flavor list
+----+---------------+-------+------+-----------+-------+-----------+
| ID | Name          |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+---------------+-------+------+-----------+-------+-----------+
| 1  | m1.tiny       |   512 |    1 |         0 |     1 | True      |
| 2  | m1.small      |  2048 |   20 |         0 |     1 | True      |
| 3  | m1.medium     |  4096 |   40 |         0 |     2 | True      |
| 4  | m1.large      |  8192 |   80 |         0 |     4 | True      |
| 5  | m1.xlarge     | 16384 |  160 |         0 |     8 | True      |
| 6  | m1.testflavor |  1000 |    2 |         0 |     1 | True      |
+----+---------------+-------+------+-----------+-------+-----------+
[root@openstack ~(keystone_teguht)]# openstack flavor show m1.testflavor
+----------------------------+---------------+
| Field                      | Value         |
+----------------------------+---------------+
| OS-FLV-DISABLED:disabled   | False         |
| OS-FLV-EXT-DATA:ephemeral  | 0             |
| access_project_ids         | None          |
| disk                       | 2             |
| id                         | 6             |
| name                       | m1.testflavor |
| os-flavor-access:is_public | True          |
| properties                 |               |
| ram                        | 1000          |
| rxtx_factor                | 1.0           |
| swap                       |               |
| vcpus                      | 1             |
+----------------------------+---------------+
[root@openstack ~(keystone_teguht)]#

11. create instance as example 2 instance(server)
# openstack server create --nic net-id=priv_net --security-group teguht-security --image cirros-Image --flavor m1.testflavor --key-name teguht-keypair --wait teguht-custom01
# openstack server create --nic net-id=priv_net --security-group teguht-security --image cirros-Image --flavor m1.testflavor --key-name teguht-keypair --wait teguht-custom02
# openstack server list
# openstack server show teguht-custom01
# openstack server show teguht-custom02

sample
[root@openstack data(keystone_teguht)]# openstack server create --nic net-id=priv_net --security-group teguht-security --image cirros-Image --flavor m1.testflavor --key-name teguht-keypair --wait teguht-custom

+--------------------------------------+----------------------------------------------------------+
| Field                                | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-STS:power_state               | Running                                                  |
| OS-EXT-STS:task_state                | None                                                     |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2018-05-14T10:33:56.000000                               |
| OS-SRV-USG:terminated_at             | None                                                     |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| addresses                            | priv_net=2.2.2.16                                        |
| adminPass                            | DZLa3nFwwgQy                                             |
| config_drive                         |                                                          |
| created                              | 2018-05-14T10:33:48Z                                     |
| flavor                               | m1.testflavor (6)                                        |
| hostId                               | 276d89873d80c369ef04a63c02362e6dde8b3186d23e3853f2b6954e |
| id                                   | 17b00a2b-d697-477f-a91e-845133a501d7                     |
| image                                | cirros-Image (c92c2545-d1e1-4c91-bfb6-6d06b895063a)      |
| key_name                             | teguht-keypair                                           |
| name                                 | teguht-custom                                            |
| os-extended-volumes:volumes_attached | []                                                       |
| progress                             | 0                                                        |
| project_id                           | 0fc7bb90bc714c8685108415557f08a2                         |
| properties                           |                                                          |
| security_groups                      | [{u'name': u'teguht-security'}]                          |
| status                               | ACTIVE                                                   |
| updated                              | 2018-05-14T10:33:56Z                                     |
| user_id                              | 8458f9a2a29f4c5d8f4e69fc066bd300                         |
+--------------------------------------+----------------------------------------------------------+
[root@openstack data(keystone_teguht)]#
[root@openstack ~(keystone_teguht)]# openstack server list
+--------------------------------------+-----------------+--------+---------------------------------+--------------+
| ID                                   | Name            | Status | Networks                        | Image Name   |
+--------------------------------------+-----------------+--------+---------------------------------+--------------+
| 326bf987-0af4-4e82-8669-2c849ceb0348 | teguht-custom02 | ACTIVE | priv_net=2.2.2.11, 172.30.1.11 | cirros-Image |
| 656fe67f-d9d3-4ff5-a880-3238cce3655f | teguht-custom01 | ACTIVE | priv_net=2.2.2.14, 172.30.1.15 | cirros-Image |
+--------------------------------------+-----------------+--------+---------------------------------+--------------+
[root@openstack ~(keystone_teguht)]# openstack server show teguht-custom01
+--------------------------------------+----------------------------------------------------------+
| Field                                | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-STS:power_state               | Running                                                  |
| OS-EXT-STS:task_state                | None                                                     |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2018-05-15T19:59:26.000000                               |
| OS-SRV-USG:terminated_at             | None                                                     |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| addresses                            | priv_net=2.2.2.14, 172.30.1.15                          |
| config_drive                         |                                                          |
| created                              | 2018-05-15T19:59:18Z                                     |
| flavor                               | m1.testflavor (6)                                        |
| hostId                               | 276d89873d80c369ef04a63c02362e6dde8b3186d23e3853f2b6954e |
| id                                   | 656fe67f-d9d3-4ff5-a880-3238cce3655f                     |
| image                                | cirros-Image (7bfa53ea-fe39-4d44-860a-b6495a5f24fc)      |
| key_name                             | teguht-keypair                                           |
| name                                 | teguht-custom01                                          |
| os-extended-volumes:volumes_attached | []                                                       |
| progress                             | 0                                                        |
| project_id                           | 0fc7bb90bc714c8685108415557f08a2                         |
| properties                           |                                                          |
| security_groups                      | [{u'name': u'teguht-security'}]                          |
| status                               | ACTIVE                                                   |
| updated                              | 2018-05-15T19:59:26Z                                     |
| user_id                              | 8458f9a2a29f4c5d8f4e69fc066bd300                         |
+--------------------------------------+----------------------------------------------------------+
[root@openstack ~(keystone_teguht)]# openstack server show teguht-custom02
+--------------------------------------+----------------------------------------------------------+
| Field                                | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-STS:power_state               | Running                                                  |
| OS-EXT-STS:task_state                | None                                                     |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2018-05-15T19:59:44.000000                               |
| OS-SRV-USG:terminated_at             | None                                                     |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| addresses                            | priv_net=2.2.2.11, 172.30.1.11                          |
| config_drive                         |                                                          |
| created                              | 2018-05-15T19:59:34Z                                     |
| flavor                               | m1.testflavor (6)                                        |
| hostId                               | 276d89873d80c369ef04a63c02362e6dde8b3186d23e3853f2b6954e |
| id                                   | 326bf987-0af4-4e82-8669-2c849ceb0348                     |
| image                                | cirros-Image (7bfa53ea-fe39-4d44-860a-b6495a5f24fc)      |
| key_name                             | teguht-keypair                                           |
| name                                 | teguht-custom02                                          |
| os-extended-volumes:volumes_attached | []                                                       |
| progress                             | 0                                                        |
| project_id                           | 0fc7bb90bc714c8685108415557f08a2                         |
| properties                           |                                                          |
| security_groups                      | [{u'name': u'teguht-security'}]                          |
| status                               | ACTIVE                                                   |
| updated                              | 2018-05-15T19:59:44Z                                     |
| user_id                              | 8458f9a2a29f4c5d8f4e69fc066bd300                         |
+--------------------------------------+----------------------------------------------------------+
[root@openstack ~(keystone_teguht)]#

12. add server floating ip
# source /root/keystonerc_teguht
# openstack server add floating ip teguht-custom01 172.30.1.15
# openstack server add floating ip teguht-custom02 172.30.1.11
sample
[root@openstack ~(keystone_teguht)]# openstack server add floating ip teguht-custom01 172.30.1.15
You have new mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]# openstack server add floating ip teguht-custom02 172.30.1.11
[root@openstack ~(keystone_teguht)]#

13. Open console Instance 1(teguht-custom01 )and test ping IP
# hostname
# ping -c1 2.2.2.11
# ping -c1 172.30.1.11
# ping -c1 2.2.2.14
# ping -c1 172.30.1.15
# ping -c1 172.30.2.24
# ping -c1 8.8.8.8

[root@openstack ~(keystone_teguht)]# ssh cirros@172.30.1.15
The authenticity of host '172.30.1.15 (172.30.1.15)' can't be established.
ECDSA key fingerprint is SHA256:zMTpSeErWRSVdHlJl936TYuMY8sUwI2yxhD6HR8SDiI.
ECDSA key fingerprint is MD5:d0:d8:77:2d:27:0f:0f:98:c8:7f:cd:d8:0e:81:46:cc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.30.1.15' (ECDSA) to the list of known hosts.
cirros@172.30.1.15's password:
$ hostname
teguht-custom01
$ ping -c1 2.2.2.11
PING 2.2.2.11 (2.2.2.11): 56 data bytes
64 bytes from 2.2.2.11: seq=0 ttl=64 time=32.071 ms

--- 2.2.2.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 32.071/32.071/32.071 ms
$ ping -c1 2.2.2.14
PING 2.2.2.14 (2.2.2.14): 56 data bytes
64 bytes from 2.2.2.14: seq=0 ttl=64 time=19.510 ms

--- 2.2.2.14 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 19.510/19.510/19.510 ms
$ ping -c1 172.30.1.11
PING 172.30.1.11 (172.30.1.11): 56 data bytes
64 bytes from 172.30.1.11: seq=0 ttl=63 time=1.728 ms

--- 172.30.1.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.728/1.728/1.728 ms
$ ping -c1 172.30.1.15
PING 172.30.1.15 (172.30.1.15): 56 data bytes
64 bytes from 172.30.1.15: seq=0 ttl=63 time=1.902 ms

--- 172.30.1.15 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.902/1.902/1.902 ms
$ ping -c1 172.30.1.24
PING 172.30.1.24 (172.30.1.24): 56 data bytes
64 bytes from 172.30.1.24: seq=0 ttl=125 time=15.278 ms

--- 172.30.1.24 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 15.278/15.278/15.278 ms
$ ping -c1 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=53 time=23.257 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 23.257/23.257/23.257 ms
$ exitConnection to 172.30.1.15 closed.
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]# 

14. Open console Instance 2(teguht-custom02 )and test ping IP
# hostname
# ping -c1 2.2.2.11
# ping -c1 172.30.1.11
# ping -c1 2.2.2.14
# ping -c1 172.30.1.15
# ping -c1 172.30.2.24
# ping -c1 8.8.8.8

[root@openstack ~(keystone_teguht)]# ssh cirros@172.30.1.11
The authenticity of host '172.30.1.11 (172.30.1.11)' can't be established.
ECDSA key fingerprint is SHA256:cTStLpL34qFr6lhsKdgQ2gnXgAmY+jVogb+cFEIGoLA.
ECDSA key fingerprint is MD5:ff:6b:71:41:ab:cc:77:88:7e:30:e4:89:84:a6:c7:e5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.30.1.11' (ECDSA) to the list of known hosts.
cirros@172.30.1.11's password:
$ hostname
teguht-custom02
$ ping -c1 2.2.2.11
PING 2.2.2.11 (2.2.2.11): 56 data bytes
64 bytes from 2.2.2.11: seq=0 ttl=64 time=65.375 ms

--- 2.2.2.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 65.375/65.375/65.375 ms
$ ping -c1 2.2.2.14
PING 2.2.2.14 (2.2.2.14): 56 data bytes
64 bytes from 2.2.2.14: seq=0 ttl=64 time=76.163 ms

--- 2.2.2.14 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 76.163/76.163/76.163 ms
$ ping -c1 172.30.1.11
PING 172.30.1.11 (172.30.1.11): 56 data bytes
64 bytes from 172.30.1.11: seq=0 ttl=63 time=87.308 ms

--- 172.30.1.11 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 87.308/87.308/87.308 ms
$ ping -c1 172.30.1.15
PING 172.30.1.15 (172.30.1.15): 56 data bytes
64 bytes from 172.30.1.15: seq=0 ttl=63 time=71.663 ms

--- 172.30.1.15 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 71.663/71.663/71.663 ms
$ ping -c1 172.30.1.24
PING 172.30.1.24 (172.30.1.24): 56 data bytes
64 bytes from 172.30.1.24: seq=0 ttl=125 time=44.970 ms

--- 172.30.1.24 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 44.970/44.970/44.970 ms
$ cat /etc/hosts
127.0.0.1    localhost
127.0.1.1    cirros
$ exit
Connection to 172.30.1.11 closed.
You have mail in /var/spool/mail/root
[root@openstack ~(keystone_teguht)]#

15. Check Network Topology for your project


16. Detail lab as

.::: How to Install and Configuration PCS, COROSYNC, and Pacemaker for HA(High Availability) On Linux, Centos, Rhel :::.

$
0
0
Corosync is an open source cluster engine used to implement high availability within applications. Commonly referred to as a messaging layer, Corosync provides a cluster membership and closed communication model for creating replicated state machines, on top of which cluster resource managers like Pacemaker can run. Corosync can be seen as the underlying system that connects the cluster nodes together, while Pacemaker monitors the cluster and takes action in the event of a failure.

This tutorial will demonstrate how to use Corosync and Pacemaker to create a high availability (HA) infrastructure on DigitalOcean with CentOS 7 servers and Floating IPs. To facilitate the process of setting up and managing the cluster nodes, we are going to use PCS, a command line interface that interacts with both Corosync and Pacemaker.A. Pre Activity

1. Editing Network
Server01
# vi /etc/sysconfig/network-script/eth0
IPADDR = 10.10.10.10
PREFIX = 24
GATEWAY = 10.10.10.1
STATIC

Server02
# vi /etc/sysconfig/network-script/eth0
IPADDR = 10.10.10.20
PREFIX = 24
GATEWAY = 10.10.10.1
STATIC

2. Verify network
Server01 and Server02
# ip ad
# ping -c1 10.10.10.10
# ping -c1 10.10.10.20
vi /etc/hosts
10.10.10.10 teguht-ha01
10.10.10.20 teguht-ha02

sample output
[root@teguht-ha01 ~]# cat /etc/hosts
127.0.0.1    localhost   localhost.localdomain  .localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.10 teguht-ha01
10.10.10.20 teguht-ha02
[root@teguht-ha01 ~]#

from Server01
[root@teguht-ha01 ~]# ping -c1 teguht-ha01
PING teguht-ha01 (10.10.10.10) 56(84) bytes of data.
64 bytes from teguht-ha01 (10.10.10.10): icmp_seq=1 ttl=64 time=0.043 ms

--- teguht-ha01 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.043/0.043/0.043/0.000 ms
[root@teguht-ha01 ~]#
[root@teguht-ha01 ~]# ping -c1 teguht-ha02
PING teguht-ha02 (10.10.10.20) 56(84) bytes of data.
64 bytes from teguht-ha02 (10.10.10.20): icmp_seq=1 ttl=64 time=0.491 ms

--- teguht-ha02 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.491/0.491/0.491/0.000 ms
[root@teguht-ha01 ~]#

from Server02
[root@teguht-ha02 ~]# ping -c1 teguht-ha01
PING teguht-ha01 (10.10.10.10) 56(84) bytes of data.
64 bytes from teguht-ha01 (10.10.10.10): icmp_seq=1 ttl=64 time=0.673 ms

--- teguht-ha01 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.673/0.673/0.673/0.000 ms
[root@teguht-ha02 ~]#
[root@teguht-ha02 ~]# ping -c1 teguht-ha02
PING teguht-ha02 (10.10.10.20) 56(84) bytes of data.
64 bytes from teguht-ha02 (10.10.10.20): icmp_seq=1 ttl=64 time=0.044 ms

--- teguht-ha02 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.044/0.044/0.044/0.000 ms
[root@teguht-ha02 ~]#
[root@teguht-ha02 ~]#

3. Configure SSH in Server01
# ssh-keygen -t dsa -f ~/.ssh/id_dsa -N ""
# scp -r ~/.ssh teguht-ha02:
# ssh teguht-ha02 -- uname -n

4. Update Configuration Server01 and Server02
# yum -y update


B. Instalation and Configuration PCS, COROSYNC, and Pacemaker

1. Install the Cluster Software on Server01 and Server02
# yum install -y pacemaker pcs psmisc policycoreutils-python
# firewall-cmd --permanent --add-service=high-availability
# firewall-cmd --reload
# systemctl disable firewalld
# systemctl stop firewalld
# systemctl start pcsd.service
# systemctl enable pcsd.service

2. enable password hacluster Server01 and Server02
# echo "recomendation password as same as root"
# passwd hacluster

3. Configure Corosync on Server01
# pcs cluster auth teguht-ha01 teguht-ha02
# pcs cluster setup --name mycluster teguht-ha01 teguht-ha02

4. Start cluster on Server01
# pcs cluster start --all

5. Start and Enable service Server01 and Server02
# systemctl enable corosync.service
# systemctl enable pacemaker.service
# systemctl enable pcsd.service
# pcs status
# pcs property set stonith-enabled=false
# crm_verify -L

output
[root@teguht-ha01 ~]# pcs status
Cluster name: mycluster
Stack: corosync
Current DC: teguht-ha01 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum
Last updated: Tue Aug 28 15:59:07 2018
Last change: Sat Aug 25 11:05:01 2018 by root via cibadmin on teguht-ha01

2 nodes configured
1 resource configured

Online: [ teguht-ha01 teguht-ha02 ]

Full list of resources:

 ClusterIP    (ocf::heartbeat:IPaddr2):    Started teguht-ha01

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@teguht-ha01 ~]#

6. Add ClusterIP/FloatingIP/VirtualIP on Server01
# pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=10.10.10.30 cidr_netmask=24 nic=eth0 op monitor interval=30s

7. Check pcs Status
# pcs status

[root@teguht-ha01 ~]# pcs status
Cluster name: mycluster
Stack: corosync
Current DC: teguht-ha01 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum
Last updated: Tue Aug 28 15:57:57 2018
Last change: Sat Aug 25 11:05:01 2018 by root via cibadmin on teguht-ha01

2 nodes configured
1 resource configured

Online: [ teguht-ha01 teguht-ha02 ]

Full list of resources:

 ClusterIP    (ocf::heartbeat:IPaddr2):    Started teguht-ha01

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@teguht-ha01 ~]#

root@teguht-ha02 ~]# pcs status
Cluster name: mycluster
Stack: corosync
Current DC: teguht-ha01 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum
Last updated: Tue Aug 28 15:59:12 2018
Last change: Sat Aug 25 11:05:01 2018 by root via cibadmin on teguht-ha01

2 nodes configured
1 resource configured

Online: [ teguht-ha01 teguht-ha02 ]

Full list of resources:

 ClusterIP    (ocf::heartbeat:IPaddr2):    Started teguht-ha01

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@teguht-ha02 ~]#

8. Test Failover

Acton Server01

# echo "if you want to test failover"
# pcs cluster stop teguht-ha01
# pcs status
Error: cluster is not currently running on this node

[root@teguht-ha01 ~]# pcs cluster stop teguht-ha01
teguht-ha01: Stopping Cluster (pacemaker)...
teguht-ha01: Stopping Cluster (corosync)...
[root@teguht-ha01 ~]#
[root@teguht-ha01 ~]# pcs status
Error: cluster is not currently running on this node
[root@teguht-ha01 ~]#

Action Server02
# pcs status

[root@teguht-ha02 ~]# pcs status
Cluster name: mycluster
Stack: corosync
Current DC: teguht-ha02 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum
Last updated: Tue Aug 28 16:00:54 2018
Last change: Sat Aug 25 11:05:01 2018 by root via cibadmin on teguht-ha01

2 nodes configured
1 resource configured

Online: [ teguht-ha02 ]
OFFLINE: [ teguht-ha01 ]

Full list of resources:

 ClusterIP    (ocf::heartbeat:IPaddr2):    Started teguht-ha02

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@teguht-ha02 ~]#

9. if you want to Set Master to Master(Replica) and Master to Slave(Mirroring) On MySQL (Include MariaDB) visit
http://teguhth.blogspot.com/2018/08/how-to-redundant-set-master-to-master.html

.::: How To Redundant Set Master to Master(Replica) and Master to Slave(Mirroring) On MySQL (Include MariaDB) :::.

$
0
0
A. Configuring MySQL Server on Server01
1. Edit & add db file conf /etc/my.cnf
server_id=1
replicate-do-db=teguht
#bind-address=10.10.10.10
log-bin      = mysql-bin
binlog_do_db = teguht

sample log

[root@teguht01 ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
server_id=1
replicate-do-db=teguht
#bind-address=10.10.10.10
log-bin      = mysql-bin
binlog_do_db = teguht
relay-log = /var/lib/mysql/mysql-relay-bin
relay-log-index = /var/lib/mysql/mysql-relay-bin.index
log-error = /var/lib/mysql/mysql.err
master-info-file = /var/lib/mysql/mysql-master.info
relay-log-info-file = /var/lib/mysql/mysql-relay-log.info
log-bin = /var/lib/mysql/mysql-bin
[mysqld_safe]
#log-error=/var/log/mariadb/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[root@teguht01 ~]#

2. Log on to the MariaDB server01 as root, create the user slave and assign the necessary grants
create database teguht;
CREATE USER 'replica'@'localhost' IDENTIFIED BY 'password';
grant replication slave on *.* to replica@'%' identified by 'password';
flush privileges;
SHOW GRANTS FOR replica@'%';
exit

sample log

mysql> create database teguht;
mysql> CREATE USER 'replica'@'localhost' IDENTIFIED BY 'password';
mysql> grant replication slave on *.* to replica@'%' identified by 'password';
mysql> flush privileges;
mysql> SHOW GRANTS FOR replica@'%';
Mysql> exit

3. Log on to the MariaDB server as root, create the user slave and assign the necessary grants
show master status

mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000001 |     2511 | teguht       |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

mysql>

4. record master status on notepad from result output status server01
change master to master_host='10.10.10.20', master_user='replica', master_password='password', master_log_file='mysql-bin.000001', master_log_pos=2511;

5. Snapsot Database MySQL
# mysqldump -u root -p  teguht  > /data/backup/teguht.sql

6. Copied to server 2
# scp /data/backup/teguht.sql root@10.10.10.20:/root/

B. Configuring MySQL Server on Server02

1. Edit & add db file conf /etc/my.cnf
server_id=2
replicate-do-db=teguht
#bind-address=10.10.10.20
log-bin      = mysql-bin
binlog_do_db = teguht

sample log

[root@teguht02 ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
server_id=2
replicate-do-db=teguht
#bind-address=10.10.10.20
log-bin      = mysql-bin
binlog_do_db = teguht
relay-log = /var/lib/mysql/mysql-relay-bin
relay-log-index = /var/lib/mysql/mysql-relay-bin.index
log-error = /var/lib/mysql/mysql.err
master-info-file = /var/lib/mysql/mysql-master.info
relay-log-info-file = /var/lib/mysql/mysql-relay-log.info
log-bin = /var/lib/mysql/mysql-bin
[mysqld_safe]
#log-error=/var/log/mariadb/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[root@teguht01 ~]#

2. Log on to the MariaDB server02 as root, create the user slave and assign the necessary grants
create database teguht;
CREATE USER 'replica'@'localhost' IDENTIFIED BY 'password';
grant replication slave on *.* to replica@'%' identified by 'password';
flush privileges;
SHOW GRANTS FOR replica@'%';
exit

sample log

mysql> create database teguht;
mysql> CREATE USER 'replica'@'localhost' IDENTIFIED BY 'password';
mysql> grant replication slave on *.* to replica@'%' identified by 'password';
mysql> flush privileges;
mysql> SHOW GRANTS FOR replica@'%';
Mysql> exit

3. Log on to the MariaDB server as root, create the user slave and assign the necessary grants
show master status

sample log

mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000002 |     2522 | teguht       |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

mysql>

4. record master status on notepad from result output status server02
change master to master_host='10.10.10.20', master_user='replica', master_password='password', master_log_file='mysql-bin.000002', master_log_pos=2522;


C. Set Master to Master On Server01 if you want to set Master to slave, donot do it

1. Set master to master status on MySQL Server01
stop slave;
change master to master_host='10.10.10.20', master_user='replica', master_password='password', master_log_file='mysql-bin.000002', master_log_pos=2522;
start slave;
SHOW SLAVE STATUS\G;

sample output

mysql> stop slave;
mysql> change master to master_host='10.10.10.20', master_user='replica', master_password='password', master_log_file='mysql-bin.000002', master_log_pos=2522;
mysql> start slave;
mysql> SHOW SLAVE STATUS\G;

2. Checking master status
mysql> SHOW SLAVE STATUS\G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 10.10.10.20
                  Master_User: replica
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 2896
               Relay_Log_File: mysql-relay-bin.000002
                Relay_Log_Pos: 617
        Relay_Master_Log_File: mysql-bin.000001
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: teguht
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 2896
              Relay_Log_Space: 790
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: 7f28cbab-a449-11e8-8cd0-000c29e77568
             Master_Info_File: /var/lib/mysql/mysql-master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
1 row in set (0.00 sec)

ERROR:
No query specified

mysql>

D. Set Master to Master On Server02

1. Set master to master status on MySQL Server02
stop slave;
change master to master_host='10.10.10.10', master_user='replica', master_password='password', master_log_file='mysql-bin.000001', master_log_pos=2511;
start slave;
SHOW SLAVE STATUS\G;

sample output

mysql> stop slave;
mysql> change master to master_host='10.10.10.10', master_user='replica', master_password='password', master_log_file='mysql-bin.000001', master_log_pos=2511;
mysql> start slave;
mysql> SHOW SLAVE STATUS\G;

2. Checking master status
mysql> SHOW SLAVE STATUS\G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 10.10.10.10
                  Master_User: replica
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 2896
               Relay_Log_File: mysql-relay-bin.000002
                Relay_Log_Pos: 617
        Relay_Master_Log_File: mysql-bin.000001
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: teguht
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 2896
              Relay_Log_Space: 790
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: 7f28cbab-a449-11e8-8cd0-000c29e77568
             Master_Info_File: /var/lib/mysql/mysql-master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
1 row in set (0.00 sec)

ERROR:
No query specified

mysql>

E. Testing  insert table on database server01
1. Server 01

use teguht;
create table teguhttable(No int(5), Name varchar(30), Email varchar(30));
insert into teguhttable values (1,'Teguh','teguh@microsoft.com');
insert into teguhttable values (2,'Tri','tri@microsoft.com');
select * from teguhttable;

sample log
[root@teguht01 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.34-log MySQL Community Server (GPL)

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> use teguht;
Database changed
mysql> create table teguhttable(No int(5), Name varchar(30), Email varchar(30));
Query OK, 0 rows affected (0.01 sec)

mysql> insert into teguhttable values (1,'Teguh','teguh@microsoft.com');
Query OK, 1 row affected (0.00 sec)

mysql> insert into teguhttable values (2,'Tri','tri@microsoft.com');
Query OK, 1 row affected (0.01 sec)

mysql> select * from teguhttable;
+------+-------+---------------------+
| No   | Name  | Email               |
+------+-------+---------------------+
|    1 | Teguh | teguh@microsoft.com |
|    2 | Tri   | tri@microsoft.com   |
+------+-------+---------------------+
2 rows in set (0.01 sec)

mysql>


2. Server02
use teguht;
SELECT * FROM teguhttable;

sample log

[root@teguht02 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.34-log MySQL Community Server (GPL)

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> use teguht;
Database changed

mysql> select * from teguhttable;
+------+-------+---------------------+
| No   | Name  | Email               |
+------+-------+---------------------+
|    1 | Teguh | teguh@microsoft.com |
|    2 | Tri   | tri@microsoft.com   |
+------+-------+---------------------+
2 rows in set (0.01 sec)

mysql>

F. Testing  insert table on database server02
1. Server02

use teguht;
insert into teguhttable values (3,'Harto','harto@microsoft.com');
insert into teguhttable values (4,'TH','th@microsoft.com');
select * from teguhttable;

sample log

[root@teguht02 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.34-log MySQL Community Server (GPL)

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> use teguht;
Database changed
mysql> insert into teguhttable values (3,'Harto','harto@microsoft.com');
Query OK, 1 row affected (0.01 sec)

mysql> insert into teguhttable values (4,'TH','th@microsoft.com');
Query OK, 1 row affected (0.01 sec)

mysql> select * from teguhttable;
+------+-------+---------------------+
| No   | Name  | Email               |
+------+-------+---------------------+
|    1 | Teguh | teguh@microsoft.com |
|    2 | Tri   | tri@microsoft.com   |
|    3 | Harto | harto@microsoft.com |
|    4 | TH    | th@microsoft.com    |
+------+-------+---------------------+
4 rows in set (0.00 sec)

mysql>

2. Server01
[root@teguht01 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.34-log MySQL Community Server (GPL)

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> use teguht;
Database changed

mysql> select * from teguhttable;
+------+-------+---------------------+
| No   | Name  | Email               |
+------+-------+---------------------+
|    1 | Teguh | teguh@microsoft.com |
|    2 | Tri   | tri@microsoft.com   |
|    3 | Harto | harto@microsoft.com |
|    4 | TH    | th@microsoft.com    |
+------+-------+---------------------+
4 rows in set (0.00 sec)

mysql> 


G. If You want to Install and Configuration PCS, COROSYNC, and Pacemaker for HA(High Availability) On Linux, Centos, Rhel visit
http://teguhth.blogspot.com/2018/08/how-to-install-and-configuration-pcs.html

I. if you get Error "Duplicate entry"  on slave or master go to http://teguhth.blogspot.com/2018/09/how-to-simple-troubleshooting-error.html

Viewing all 413 articles
Browse latest View live