Jumat, 22 November 2019

How to install vmware tools plugins with open vm tools on Linux centos 7

  Tidak ada komentar
Install vm tools
[root@localhost ~]# yum install open-vm-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                           |  10 kB  00:00:00
 * base: mirror.dionipe.net
 * epel: kartolo.sby.datautama.net.id
 * extras: mirror.dionipe.net
 * updates: mirror.dionipe.net
as-repo-centos7                                                                                                | 2.9 kB  00:00:00
base                                                                                                           | 3.6 kB  00:00:00
cheese                                                                                                         | 3.4 kB  00:00:00
cr                                                                                                             | 2.9 kB  00:00:00
epel                                                                                                           | 5.3 kB  00:00:00
extras                                                                                                         | 2.9 kB  00:00:00
mongodb-org-4.0                                                                                                | 2.5 kB  00:00:00
pritunl                                                                                                        | 2.9 kB  00:00:00
updates                                                                                                        | 2.9 kB  00:00:00
(1/4): as-repo-centos7/primary_db                                                                              | 2.5 kB  00:00:00
(2/4): epel/x86_64/updateinfo                                                                                  | 1.0 MB  00:00:00
(3/4): epel/x86_64/primary_db                                                                                  | 6.9 MB  00:00:02
(4/4): cheese/7/x86_64/primary_db                                                                              | 539 kB  00:00:04
Resolving Dependencies
--> Running transaction check
---> Package open-vm-tools.x86_64 0:10.3.0-2.el7 will be installed
--> Processing Dependency: xmlsec1-openssl for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: pciutils for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.6)(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.5)(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: fuse for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libxmlsec1.so.1()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libmspack.so.0()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libltdl.so.7()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libicuuc.so.50()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libicui18n.so.50()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libicudata.so.50()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libfuse.so.2()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libdnet.so.1()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Running transaction check
---> Package fuse.x86_64 0:2.9.2-11.el7 will be installed
---> Package fuse-libs.x86_64 0:2.9.2-11.el7 will be installed
---> Package libdnet.x86_64 0:1.12-13.1.el7 will be installed
---> Package libicu.x86_64 0:50.2-3.el7 will be installed
---> Package libmspack.x86_64 0:0.5-0.7.alpha.el7 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package pciutils.x86_64 0:3.5.1-3.el7 will be installed
---> Package xmlsec1.x86_64 0:1.2.20-7.el7_4 will be installed
---> Package xmlsec1-openssl.x86_64 0:1.2.20-7.el7_4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                             Arch                       Version                                Repository                Size
======================================================================================================================================
Installing:
 open-vm-tools                       x86_64                     10.3.0-2.el7                           base                     671 k
Installing for dependencies:
 fuse                                x86_64                     2.9.2-11.el7                           base                      86 k
 fuse-libs                           x86_64                     2.9.2-11.el7                           base                      93 k
 libdnet                             x86_64                     1.12-13.1.el7                          base                      31 k
 libicu                              x86_64                     50.2-3.el7                             base                     6.9 M
 libmspack                           x86_64                     0.5-0.7.alpha.el7                      base                      64 k
 libtool-ltdl                        x86_64                     2.4.2-22.el7_3                         base                      49 k
 pciutils                            x86_64                     3.5.1-3.el7                            base                      93 k
 xmlsec1                             x86_64                     1.2.20-7.el7_4                         base                     177 k
 xmlsec1-openssl                     x86_64                     1.2.20-7.el7_4                         base                      76 k

Transaction Summary
======================================================================================================================================
Install  1 Package (+9 Dependent packages)

Total download size: 8.2 M
Installed size: 28 M
Is this ok [y/d/N]: y
Downloading packages:
(1/10): fuse-2.9.2-11.el7.x86_64.rpm                                                                           |  86 kB  00:00:00
(2/10): libdnet-1.12-13.1.el7.x86_64.rpm                                                                       |  31 kB  00:00:00
(3/10): libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm                                                                 |  49 kB  00:00:00
(4/10): pciutils-3.5.1-3.el7.x86_64.rpm                                                                        |  93 kB  00:00:00
(5/10): libmspack-0.5-0.7.alpha.el7.x86_64.rpm                                                                 |  64 kB  00:00:00
(6/10): xmlsec1-1.2.20-7.el7_4.x86_64.rpm                                                                      | 177 kB  00:00:00
(7/10): open-vm-tools-10.3.0-2.el7.x86_64.rpm                                                                  | 671 kB  00:00:00
(8/10): xmlsec1-openssl-1.2.20-7.el7_4.x86_64.rpm                                                              |  76 kB  00:00:00
(9/10): fuse-libs-2.9.2-11.el7.x86_64.rpm                                                                      |  93 kB  00:00:00
(10/10): libicu-50.2-3.el7.x86_64.rpm                                                                          | 6.9 MB  00:00:06
--------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                 1.2 MB/s | 8.2 MB  00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libtool-ltdl-2.4.2-22.el7_3.x86_64                                                                                1/10
  Installing : xmlsec1-1.2.20-7.el7_4.x86_64                                                                                     2/10
  Installing : xmlsec1-openssl-1.2.20-7.el7_4.x86_64                                                                             3/10
  Installing : libmspack-0.5-0.7.alpha.el7.x86_64                                                                                4/10
  Installing : pciutils-3.5.1-3.el7.x86_64                                                                                       5/10
  Installing : libdnet-1.12-13.1.el7.x86_64                                                                                      6/10
  Installing : libicu-50.2-3.el7.x86_64                                                                                          7/10
  Installing : fuse-2.9.2-11.el7.x86_64                                                                                          8/10
  Installing : fuse-libs-2.9.2-11.el7.x86_64                                                                                     9/10
  Installing : open-vm-tools-10.3.0-2.el7.x86_64                                                                                10/10
  Verifying  : open-vm-tools-10.3.0-2.el7.x86_64                                                                                 1/10
  Verifying  : fuse-libs-2.9.2-11.el7.x86_64                                                                                     2/10
  Verifying  : fuse-2.9.2-11.el7.x86_64                                                                                          3/10
  Verifying  : xmlsec1-openssl-1.2.20-7.el7_4.x86_64                                                                             4/10
  Verifying  : libicu-50.2-3.el7.x86_64                                                                                          5/10
  Verifying  : xmlsec1-1.2.20-7.el7_4.x86_64                                                                                     6/10
  Verifying  : libdnet-1.12-13.1.el7.x86_64                                                                                      7/10
  Verifying  : libtool-ltdl-2.4.2-22.el7_3.x86_64                                                                                8/10
  Verifying  : pciutils-3.5.1-3.el7.x86_64                                                                                       9/10
  Verifying  : libmspack-0.5-0.7.alpha.el7.x86_64                                                                               10/10

Installed:
  open-vm-tools.x86_64 0:10.3.0-2.el7

Dependency Installed:
  fuse.x86_64 0:2.9.2-11.el7            fuse-libs.x86_64 0:2.9.2-11.el7              libdnet.x86_64 0:1.12-13.1.el7
  libicu.x86_64 0:50.2-3.el7            libmspack.x86_64 0:0.5-0.7.alpha.el7         libtool-ltdl.x86_64 0:2.4.2-22.el7_3
  pciutils.x86_64 0:3.5.1-3.el7         xmlsec1.x86_64 0:1.2.20-7.el7_4              xmlsec1-openssl.x86_64 0:1.2.20-7.el7_4

Complete!
[root@localhost ~]#
Enable service on start up
[root@localhost ~]# systemctl enable vmtoolsd
[root@localhost ~]# systemctl status vmtoolsd
● vmtoolsd.service - Service for virtual machines hosted on VMware
   Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: http://github.com/vmware/open-vm-tools
[root@localhost ~]#
Start the vm tools
[root@localhost ~]# systemctl start vmtoolsd
[root@localhost ~]# systemctl status vmtoolsd
● vmtoolsd.service - Service for virtual machines hosted on VMware
   Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2019-11-23 12:29:53 WIB; 1s ago
     Docs: http://github.com/vmware/open-vm-tools
 Main PID: 24901 (vmtoolsd)
   CGroup: /system.slice/vmtoolsd.service
           └─24901 /usr/bin/vmtoolsd

Nov 23 12:29:53 localhost.localdomain systemd[1]: Started Service for virtual machines hosted on VMware.
[root@localhost ~]#

MySQL Basic command line on Linux terminal

  Tidak ada komentar
Enter to mysql with mysql client
myuser@mydbserver ~ $ mysql -u mysqluser -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2011796572
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, 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>
Show databases list
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mydatabase         |
| mysql              |
+--------------------+
3 rows in set (0.00 sec)

mysql>

Use database mydatabase
mysql> use mydatabase;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>


Show tables from mysql database;

mysql> show tables;
+-------------------------+
| Tables_in_billing_pnc   |
+-------------------------+
| log_check        |
| mstakun                 |
..
..
| tuser                 |
| tuser_old             |
+-------------------------+
31 rows in set (0.00 sec)

mysql>

How to install ssl certificate on pritunl server with nginx frond end

  Tidak ada komentar
Install the nginx reverse proxy server

[root@localhost ~]# yum install nginx
Change the pritunl web port to another port
[root@localhost ~]# pritunl set app.server_port 9443
app.server_port = 9443
Successfully updated configuration. This change is stored in the database and has been applied to all hosts in the cluster.

Enable reverse proxy and disable redirect

[root@localhost ~]# sudo pritunl set app.reverse_proxy true
app.reverse_proxy = true
Successfully updated configuration. This change is stored in the database and has been applied to all hosts in the cluster.
[root@localhost ~]# sudo pritunl set app.redirect_server false
app.redirect_server = false
Successfully updated configuration. This change is stored in the database and has been applied to all hosts in the cluster.
[root@localhost ~]#
Create nginx config for pritunl

[root@localhost ~]# vi /etc/nginx/conf.d/pritunl.conf
[root@localhost ~]#
The nginx configuration
[root@localhost ~]# cat /etc/nginx/conf.d/pritunl.conf
server {
    listen 80;
    server_name domain.name;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
   # listen 443;
    server_name domain.name;
    ssl_certificate           /etc/nginx/ssl/start_sertifikat.crt;
    ssl_certificate_key       /etc/nginx/ssl/start_sertifikat.key;

   # ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

    access_log            /var/log/nginx/domain.name.access.log;

    location / {

      proxy_set_header        Host $host;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;

      proxy_pass          https://localhost:9443;
      proxy_read_timeout  90;
    }
  }
[root@localhost ~]#
Test nginx configuration

[root@localhost ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@localhost ~]#
Restart pritunl service

[root@localhost ~]# service pritunl restart
Redirecting to /bin/systemctl restart pritunl.service
[root@localhost ~]#
Restart nginx configuration

[root@localhost ~]# service nginx restart
Redirecting to /bin/systemctl restart nginx.service
[root@localhost ~]# service nginx status
Redirecting to /bin/systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-11-20 21:50:32 WIB; 7s ago
  Process: 6690 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 6688 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 6686 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 6691 (nginx)
   CGroup: /system.slice/nginx.service
           ├─6691 nginx: master process /usr/sbin/nginx
           ├─6692 nginx: worker process
           ├─6693 nginx: worker process
           ├─6694 nginx: worker process
           ├─6695 nginx: worker process
           ├─6696 nginx: worker process
           ├─6697 nginx: worker process
           ├─6698 nginx: worker process
           └─6699 nginx: worker process

Nov 20 21:50:32 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
Nov 20 21:50:32 localhost.localdomain systemd[1]: nginx.service failed.
Nov 20 21:50:32 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 20 21:50:32 localhost.localdomain nginx[6688]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Nov 20 21:50:32 localhost.localdomain nginx[6688]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Nov 20 21:50:32 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
[root@localhost ~]#


How to upgrade check mk monitoring server

  Tidak ada komentar
Download the package
[user@monitor ~]$ wget https://checkmk.com/support/1.6.0p5/check-mk-raw-1.6.0p5-el6-38.x86_64.rpm
--2019-11-08 07:34:04--  https://checkmk.com/support/1.6.0p5/check-mk-raw-1.6.0p5-el6-38.x86_64.rpm
Resolving checkmk.com... 178.248.246.155
Connecting to checkmk.com|178.248.246.155|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 143366956 (137M) [application/x-redhat-package-manager]
Saving to: “check-mk-raw-1.6.0p5-el6-38.x86_64.rpm”

100%[======================================>] 143,366,956 5.54M/s   in 35s

2019-11-08 07:34:40 (3.95 MB/s) - “check-mk-raw-1.6.0p5-el6-38.x86_64.rpm” saved[143366956/143366956]

[user@monitor ~]$
Install the package with yum install command
[user@monitor ~]$ sudo yum install check-mk-raw-1.6.0p5-el6-38.x86_64.rpm
[sudo] password for user:
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Examining check-mk-raw-1.6.0p5-el6-38.x86_64.rpm: check-mk-raw-1.6.0p5-el6-38.x8                                                      6_64
Marking check-mk-raw-1.6.0p5-el6-38.x86_64.rpm to be installed
Determining fastest mirrors
http://centos.biz.net.id/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://centos.biz.net.id/6/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
epel                                                                                                           | 5.3 kB     00:00
epel/primary_db                                                                                                | 6.1 MB     00:02
http://centos.biz.net.id/6/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://centos.biz.net.id/6/extras/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
http://centos.biz.net.id/6/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://centos.biz.net.id/6/updates/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
Resolving Dependencies
--> Running transaction check
---> Package check-mk-raw-1.6.0p5.x86_64 0:el6-38 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                            Arch                 Version              Repository                                         Size
======================================================================================================================================
Installing:
 check-mk-raw-1.6.0p5               x86_64               el6-38               /check-mk-raw-1.6.0p5-el6-38.x86_64               585 M

Transaction Summary
======================================================================================================================================
Install       1 Package(s)

Total size: 585 M
Installed size: 585 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : check-mk-raw-1.6.0p5-el6-38.x86_64                                                                                 1/1
New default version is 1.6.0p5.cre.
Installing SysV init script: omd
  Verifying  : check-mk-raw-1.6.0p5-el6-38.x86_64                                                                                 1/1

Installed:
  check-mk-raw-1.6.0p5.x86_64 0:el6-38

Complete!
[user@monitor ~]$
Check mk site status
[user@monitor ~]$ sudo omd status mymonitor
[sudo] password for user:
Doing 'status' on site mymonitor:
rrdcached:      running
npcd:           running
nagios:         running
apache:         running
xinetd:         running
crontab:        running
-----------------------
Overall state:  running

[user@monitor ~]$ 
Stop cmk site
[user@monitor ~]$ sudo omd stop mymonitor
Doing 'stop' on site mymonitor:
Removing Crontab...
Stopping xinetd...OK
Stopping dedicated Apache for site mymonitor.....OK
Stopping nagios.....OK
Stopping npcd...OK
Stopping rrdcached...waiting for termination...OK

[user@monitor ~]$
Perform update version
[user@monitor ~]$ sudo omd update mymonitor
Unmounting temporary filesystem...OK










                                        lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
                                        x You are going to update the site kemenhub_mon    x
                                        x from version 1.5.0p13.cre to version             x
                                        x 1.6.0p5.cre. This will include updating all of   x
                                        x you configuration files and merging changes in   x
                                        x the default files with changes made by you. In   x
                                        x case of conflicts your help will be needed.      x
                                        tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
                                        x           <Update!>      < Abort >               x
                                        mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj











2019-11-08 07:47:12 - Updating site 'mymonitor' from version 1.5.0p13.cre to 1.6.0p5.cre...

 * Updated        .profile
 * Installed link var/dokuwiki/lib/plugins/cli.php
 * Installed dir  etc/stunnel
 * Updated        etc/apache/apache.conf
 * Installed file etc/apache/conf.d/security.conf
 * Updated        etc/apache/conf.d/omd.conf
 * Installed file etc/apache/conf.d/01_wsgi.conf
 * Updated        etc/nagvis/nagvis.ini.php
 * Updated        etc/dokuwiki/local.php
 * Updated        etc/dokuwiki/mime.conf
 * Updated        etc/dokuwiki/dokuwiki.php
 * Installed file etc/init.d/stunnel
 * Updated        etc/init-hooks.d/README
 * Merged         etc/mk-livestatus/xinetd.conf
 * Installed file etc/logrotate.d/stunnel
 * Updated        etc/check_mk/apache.conf
 * Installed link etc/rc.d/85-stunnel
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/jms.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/threads.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/jdbc.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/appstate.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/jca.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/http.cfg
 * Installed file etc/stunnel/server.conf
 * Installed dir  local/share/check_mk/web/htdocs/themes
 * Vanished       local/lib/icinga
 * Vanished       local/share/icinga/htdocs
 * Vanished       local/share/icinga
 * Vanished       etc/rc.d/80-icinga
 * Vanished       etc/icinga/ssi/status-header.ssi
 * Vanished       etc/icinga/ssi/README
 * Vanished       etc/icinga/ssi/extinfo-header.ssi
 * Vanished       etc/icinga/icinga.d/omd.cfg
 * Vanished       etc/icinga/icinga.d/misc.cfg
 * Vanished       etc/icinga/icinga.d/logging.cfg
 * Vanished       etc/icinga/icinga.d/flapping.cfg
 * Vanished       etc/icinga/icinga.d/timing.cfg
 * Vanished       etc/icinga/icinga.d/freshness.cfg
 * Vanished       etc/icinga/icinga.d/tuning.cfg
 * Vanished       etc/icinga/icinga.d/obsess.cfg
 * Vanished       etc/icinga/icinga.d/mk-livestatus.cfg
 * Vanished       etc/icinga/icinga.d/dependency.cfg
 * Vanished       etc/icinga/icinga.d/eventhandler.cfg
 * Vanished       etc/icinga/icinga.d/retention.cfg
 * Vanished       etc/icinga/cgiauth.cfg
 * Vanished       etc/icinga/resource.cfg
 * Vanished       etc/icinga/cgi.cfg
 * Vanished       etc/icinga/icinga.cfg
 * Vanished       etc/icinga/config.inc.php
 * Vanished       etc/icinga/apache.conf
 * Vanished       etc/icinga/idomod.cfg-sample
 * Vanished       etc/icinga/icinga.d
 * Vanished       etc/icinga/conf.d
 * Vanished       etc/icinga/ssi
 * Vanished       etc/init.d/icinga
 * Vanished       etc/apache/conf.d/01_python.conf
 * Vanished       etc/icinga
 * Vanished       var/icinga
Executing update-pre-hooks script "cmk.update-pre-hooks"...OK
Output: Initializing application...
Loading GUI plugins...
Updating Checkmk configuration...
 + Rewriting WATO tags...
 + Rewriting WATO hosts and folders...
 + Rewriting WATO rulesets...
 + Rewriting autochecks...
 + Cleanup version specific caches...
Done

Finished update.

[user@monitor ~]$
Check cmk site status
[user@monitor ~]$ sudo omd status mymonitor
Doing 'status' on site mymonitor:
rrdcached:      stopped
npcd:           stopped
nagios:         stopped
apache:         stopped
xinetd:         stopped
crontab:        stopped
-----------------------
Overall state:  stopped

[user@monitor ~]$ 
Start cmk site
[user@monitor ~]$ sudo omd start mymonitor
Creating temporary filesystem /omd/sites/mymonitor/tmp...OK
Starting mkeventd...OK
Starting rrdcached...OK
Starting npcd...OK
Starting nagios...OK
Starting apache...OK
Initializing Crontab...OK
[user@monitor ~]$
Check version
[user@monitor ~]$ sudo omd version mymonitor
OMD - Open Monitoring Distribution Version 1.6.0p5.cre
[user@monitor ~]$

Selasa, 19 November 2019

How to config disable or offline firewalld

  Tidak ada komentar
Get active zone list
[root@svrlb_apps_bck ~]# firewall-cmd --list-all
FirewallD is not running
[root@svrlb_apps_bck ~]# 
Running firewall-offline-cmd command
[root@svrlb_apps_bck ~]# firewall-offline-cmd --add-service=http
success
[root@svrlb_apps_bck ~]# firewall-offline-cmd --add-service=https
success
[root@svrlb_apps_bck ~]# firewall-offline-cmd --add-port=6556/tcp
success
[root@svrlb_apps_bck ~]#

How to config firewalld on linux centos 7

  Tidak ada komentar
Get active zone list
[root@svrlb_apps_bck ~]# firewall-cmd --get-active-zones
dmz
  interfaces: ens192
public
  interfaces: ens160
[root@svrlb_apps_bck ~]#
Detail info of zone
[root@svrlb_apps_bck ~]# firewall-cmd --list-all --zone=dmz
dmz (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources:
  services: ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

[root@svrlb_apps_bck ~]#
Change zone of interface

[root@svrlb_apps_bck ~]# firewall-cmd --zone=dmz --change-interface=ens192
The interface is under control of NetworkManager, setting zone to 'dmz'.
success
[root@svrlb_apps_bck ~]#

How to install open vpn access server on centos 7

  Tidak ada komentar
Install open vpn as repository
[root@localhost ~]# yum -y install https://as-repository.openvpn.net/as-repo-cen                                                      tos7.rpm
Loaded plugins: fastestmirror
as-repo-centos7.rpm                                      | 8.9 kB     00:00
Examining /var/tmp/yum-root-DAkXnc/as-repo-centos7.rpm: openvpn-as-yum-7-1.noarc                                                      h
Marking /var/tmp/yum-root-DAkXnc/as-repo-centos7.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package openvpn-as-yum.noarch 0:7-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package               Arch          Version      Repository               Size
================================================================================
Installing:
 openvpn-as-yum        noarch        7-1          /as-repo-centos7        3.3 k

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

Total size: 3.3 k
Installed size: 3.3 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : openvpn-as-yum-7-1.noarch                                    1/1
  Verifying  : openvpn-as-yum-7-1.noarch                                    1/1

Installed:
  openvpn-as-yum.noarch 0:7-1

Complete!
[root@localhost ~]#
Install open vpn as with yum command
[root@localhost ~]# yum -y install openvpn-as
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.dionipe.net
 * extras: mirror.dionipe.net
 * updates: mirror.dionipe.net
as-repo-centos7                                          | 2.9 kB     00:00
base                                                     | 3.6 kB     00:00
cheese                                                                                                         | 3.4 kB  00:00:00
cr                                                                                                             | 2.9 kB  00:00:00
extras                                                                                                         | 2.9 kB  00:00:00
updates                                                                                                        | 2.9 kB  00:00:00
as-repo-centos7/primary_db                                                                                     | 2.3 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package openvpn-as.x86_64 0:2.7.5_932a08a3-CentOSrelease will be installed
--> Processing Dependency: openvpn-as-bundled-clients for package: openvpn-as-2.7.5_932a08a3-CentOSrelease.x86_64
--> Running transaction check
---> Package openvpn-as-bundled-clients.noarch 0:2-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                                Arch               Version                                  Repository                   Size
======================================================================================================================================
Installing:
 openvpn-as                             x86_64             2.7.5_932a08a3-CentOSrelease             as-repo-centos7              38 M
Installing for dependencies:
 openvpn-as-bundled-clients             noarch             2-1                                      as-repo-centos7             119 M

Transaction Summary
======================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 157 M
Installed size: 220 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/as-repo-centos7/packages/openvpn-as-2.7.5-CentOS7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 3aaaaa96: NOKEY
Public key for openvpn-as-2.7.5-CentOS7.x86_64.rpm is not installed
(1/2): openvpn-as-2.7.5-CentOS7.x86_64.rpm                                                                     |  38 MB  00:00:18
(2/2): openvpn-as-bundled-clients-2.rpm                                                                        | 119 MB  00:00:51
--------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                 3.1 MB/s | 157 MB  00:00:51
Retrieving key from file:///etc/pki/rpm-gpg/OPENVPN-AS-GPG-KEY
Importing GPG key 0x3AAAAA96:
 Userid     : "Access Server (Access Server Package Key) <[email protected]>"
 Fingerprint: 8b1b c7fe cb72 59e1 430a 3aa0 26eb 3912 3aaa aa96
 Package    : openvpn-as-yum-7-1.noarch (@/as-repo-centos7)
 From       : /etc/pki/rpm-gpg/OPENVPN-AS-GPG-KEY
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : openvpn-as-bundled-clients-2-1.noarch                                                                              1/2
  Installing : openvpn-as-2.7.5_932a08a3-CentOSrelease.x86_64                                                                     2/2

The Access Server has been successfully installed in /usr/local/openvpn_as
Configuration log file has been written to /usr/local/openvpn_as/init.log

Please enter "passwd openvpn" to set the initial
administrative password, then login as "openvpn" to continue
configuration here: https://192.168.72.26:943/admin

To reconfigure manually, use the /usr/local/openvpn_as/bin/ovpn-init tool.

+++++++++++++++++++++++++++++++++++++++++++++++
Access Server Web UIs are available here:
Admin  UI: https://192.168.72.26:943/admin
Client UI: https://192.168.72.26:943/
+++++++++++++++++++++++++++++++++++++++++++++++

Beginning with OpenVPN AS 2.6.0 compression is disabled by default and on upgrades as security patch.
  Verifying  : openvpn-as-2.7.5_932a08a3-CentOSrelease.x86_64                                                                     1/2
  Verifying  : openvpn-as-bundled-clients-2-1.noarch                                                                              2/2

Installed:
  openvpn-as.x86_64 0:2.7.5_932a08a3-CentOSrelease

Dependency Installed:
  openvpn-as-bundled-clients.noarch 0:2-1

Complete!
[root@localhost ~]#
Check open vpn as service
[root@localhost ~]# service openvpnas status
Redirecting to /bin/systemctl status openvpnas.service
● openvpnas.service - OpenVPN Access Server Service
   Loaded: loaded (/etc/systemd/system/openvpnas.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-11-12 12:02:08 WIB; 4min 6s ago
  Process: 10035 ExecStart=/usr/local/openvpn_as/scripts/openvpnas --logfile=/var/log/openvpnas.log --pidfile=/var/run/openvpnas.pid (code=exited, status=0/SUCCESS)
 Main PID: 10040 (python)
   CGroup: /system.slice/openvpnas.service
           ├─10040 python -c from pyovpn.sagent.sagent_entry import openvpnas ; openvpnas() --logfile=/var/log/openvpnas.log --pidf...
           ├─10065 python -c from pyovpn.log.logworker import start ; start()
           ├─10066 python -c from pyovpn.cserv.wserv_entry import start ; start() -no -u openvpn_as -g openvpn_as --pidfile /usr/lo...
           ├─10089 python -c from pyovpn.sagent.iptworker import start6 ; start6()
           ├─10092 python -c from pyovpn.sagent.iptworker import start ; start()
           ├─10097 openvpn-openssl --errors-to-stderr --config stdin
           ├─10103 openvpn-openssl --errors-to-stderr --config stdin
           ├─10125 openvpn-openssl --errors-to-stderr --config stdin
           ├─10128 openvpn-openssl --errors-to-stderr --config stdin
           ├─10146 openvpn-openssl --errors-to-stderr --config stdin
           ├─10149 openvpn-openssl --errors-to-stderr --config stdin
           ├─10167 openvpn-openssl --errors-to-stderr --config stdin
           ├─10170 openvpn-openssl --errors-to-stderr --config stdin
           ├─10188 openvpn-openssl --errors-to-stderr --config stdin
           ├─10191 openvpn-openssl --errors-to-stderr --config stdin
           ├─10209 openvpn-openssl --errors-to-stderr --config stdin
           ├─10212 openvpn-openssl --errors-to-stderr --config stdin
           ├─10230 openvpn-openssl --errors-to-stderr --config stdin
           ├─10233 openvpn-openssl --errors-to-stderr --config stdin
           ├─10251 openvpn-openssl --errors-to-stderr --config stdin
           ├─10254 openvpn-openssl --errors-to-stderr --config stdin
           ├─10272 openvpn-openssl --errors-to-stderr --config stdin
           ├─10280 iptables-restore -n
           ├─10293 openvpn-openssl --errors-to-stderr --config stdin
           ├─10313 openvpn-openssl --errors-to-stderr --config stdin
           ├─10333 openvpn-openssl --errors-to-stderr --config stdin
           ├─10353 openvpn-openssl --errors-to-stderr --config stdin
           ├─10373 openvpn-openssl --errors-to-stderr --config stdin
           ├─10393 openvpn-openssl --errors-to-stderr --config stdin
           └─10413 openvpn-openssl --errors-to-stderr --config stdin

Nov 12 12:02:07 localhost.localdomain systemd[1]: Starting OpenVPN Access Server Service...
Nov 12 12:02:08 localhost.localdomain systemd[1]: Started OpenVPN Access Server Service.
[root@localhost ~]#
Set open vpn as password
[root@localhost ~]# passwd openvpn
Changing password for user openvpn.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#
Check open vpn as service

Minggu, 17 November 2019

Moving Extents to a New Disk and remove old physical disk

  Tidak ada komentar

Moving Extents to a New Disk

In this example, the logical volume is distributed across three physical volumes in the volume group myvg as follows:
# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 15.15G  2.00G
  /dev/sdc1  myvg lvm2 a-   17.15G 15.15G  2.00G
This example procedure moves the extents of /dev/sdb1 to a new device, /dev/sdd1.
Create a new physical volume from /dev/sdd1.
# pvcreate /dev/sdd1
  Physical volume "/dev/sdd1" successfully created
Add the new physical volume /dev/sdd1 to the existing volume group myvg.
# vgextend myvg /dev/sdd1
  Volume group "myvg" successfully extended
# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1   myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1   myvg lvm2 a-   17.15G 15.15G  2.00G
  /dev/sdc1   myvg lvm2 a-   17.15G 15.15G  2.00G
  /dev/sdd1   myvg lvm2 a-   17.15G 17.15G     0
Use the pvmove command to move the data from /dev/sdb1 to /dev/sdd1.
# pvmove /dev/sdb1 /dev/sdd1
  /dev/sdb1: Moved: 10.0%
...
  /dev/sdb1: Moved: 79.7%
...
  /dev/sdb1: Moved: 100.0%

# pvs -o+pv_used
  PV          VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1   myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1   myvg lvm2 a-   17.15G 17.15G     0
  /dev/sdc1   myvg lvm2 a-   17.15G 15.15G  2.00G
  /dev/sdd1   myvg lvm2 a-   17.15G 15.15G  2.00G
After you have moved the data off /dev/sdb1, you can remove it from the volume group.
# vgreduce myvg /dev/sdb1
  Removed "/dev/sdb1" from volume group "myvg"
You can now reallocate the disk to another volume group or remove the disk from the system.

Moving Extents to Existing Physical Volumes and remove phisical disk

  Tidak ada komentar

Moving Extents to Existing Physical Volumes

In this example, the logical volume is distributed across four physical volumes in the volume group myvg.
# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G 15.00G
This examples moves the extents off of /dev/sdb1 so that it can be removed from the volume group.

1. If there are enough free extents on the other physical volumes in the volume group, you can execute the pvmove command on the device you want to remove with no other options and the extents will be distributed to the other devices.
# pvmove /dev/sdb1
  /dev/sdb1: Moved: 2.0%
 ...
  /dev/sdb1: Moved: 79.2%
 ...
  /dev/sdb1: Moved: 100.0%
After the pvmove command has finished executing, the distribution of extents is as follows:
# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 17.15G     0
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G 15.00G
Use the vgreduce command to remove the physical volume /dev/sdb1 from the volume group.
# vgreduce myvg /dev/sdb1
  Removed "/dev/sdb1" from volume group "myvg"
# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G
  /dev/sdb1       lvm2 --   17.15G 17.15G
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G
The disk can now be physically removed or allocated to other users.