Rabu, 08 Mei 2019

How to install and configure nfs client on suse linux

  Tidak ada komentar
Make sure nfsclient and rpcbind package already installed
sllpc:~ # zypper install nfs-client rpcbind
Refreshing service 'SUSE_Linux_Enterprise_Server_12_SP3_ppc64le'.
Loading repository data...
Reading installed packages...
'rpcbind' is already installed.
No update candidate for 'rpcbind-0.2.3-24.3.1.ppc64le'. The highest available version is already installed.
'nfs-client' is already installed.
No update candidate for 'nfs-client-1.3.0-34.8.3.ppc64le'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.
sllpc:~ #
Make directory and mount the nfs server
sllpc:~ # mkdir -p /mnt/nfs
sllpc:~ #
sllpc:~ # mount 192.168.74.61:/var/nfsshare /mnt/nfs
sllpc:~ #

Check the disk
sllpc:~ # df -h
Filesystem                                           Size  Used Avail Use% Mount                                                      ed on
devtmpfs                                             3.9G  128K  3.9G   1% /dev
tmpfs                                                3.9G     0  3.9G   0% /dev/                                                      shm
tmpfs                                                3.9G  130M  3.8G   4% /run
tmpfs                                                3.9G     0  3.9G   0% /sys/                                                      fs/cgroup

/dev/mapper/3600c0ff0003bff144cc49a5b01000000-part3   37G   24G   13G  65% /var/                                                      crash
tmpfs                                                787M     0  787M   0% /run/                                                      user/0
192.168.74.61:/var/nfsshare                             44G   37G  7.5G  83% /siml                                                      ala
sllpc:~ #

To make it permanent add the nfs to fstab config
sllpc:~ # vi /etc/fstab
sllpc:~ #
sllpc:~ # tail -n 100 /etc/fstab | grep nfs
192.168.74.61:/var/nfsshare  /mnt/nfs        nfs     defaults                0 0
sllpc:~ #

Selasa, 07 Mei 2019

How to install check mk agent on AIX Power System

  Tidak ada komentar
Copy the check mk agent from cmk monitoring server


Create check_mk_agent file and paste the text 
bash-4.2# vi /usr/bin/check_mk_agent
bash-4.2#
bash-4.2# ls -l /usr/bin/check_mk_agent
-rw-r--r--    1 root     system        12311 May 08 10:57 /usr/bin/check_mk_agent
bash-4.2#
bash-4.2# chmod 755 /usr/bin/check_mk_agent
bash-4.2#
bash-4.2# ls -l /usr/bin/check_mk_agent
-rwxr-xr-x    1 root     system        12311 May 08 10:57 /usr/bin/check_mk_agent
bash-4.2#
Change file permission to 755
bash-4.2# chmod 755 /usr/bin/check_mk_agent
bash-4.2#
bash-4.2# ls -l /usr/bin/check_mk_agent
-rwxr-xr-x    1 root     system        12311 May 08 10:57 /usr/bin/check_mk_agent
bash-4.2#
Create the check mk directory
bash-4.2# mkdir -p /usr/check_mk/lib
bash-4.2# mkdir -p /usr/check_mk/conf
bash-4.2# mkdir -p /usr/check_mk/lib/local
bash-4.2# mkdir -p /usr/check_mk/lib/plugins
bash-4.2# mkdir -p /tmp/check_mk
bash-4.2# mkdir -p /tmp/check_mk/spool
Backup the services file
bash-4.2# cp /etc/services /etc/services_backup_080519
bash-4.2#
bash-4.2# ls -l /etc/ | grep services
-rw-r--r--    1 root     system            0 Mar 07 2013  .services.lock
-r--r--r--    1 root     system         6968 Feb 28 2013  isoservices
-rw-r--r--    1 root     system       345314 Oct 07 2014  services
-rw-r--r--    1 root     system       345314 May 08 11:00 services_backup_080519
Edit the service 
bash-4.2# vi /etc/services
bash-4.2#
bash-4.2# ls -l /etc/ | grep services
-rw-r--r--    1 root     system            0 Mar 07 2013  .services.lock
-r--r--r--    1 root     system         6968 Feb 28 2013  isoservices
-rw-r--r--    1 root     system       345386 May 08 11:02 services
-rw-r--r--    1 root     system       345314 May 08 11:00 services_backup_080519
bash-4.2#
Add following text under Network services, Internet style
# Network services, Internet style
#
#                               0/tcp           # Reserved
#                               0/udp           # Reserved

check_mk                6556/tcp        # TCP Port for Check Mk Agent

Check the file
bash-4.2# ls -l /etc/ | grep services
-rw-r--r--    1 root     system            0 Mar 07 2013  .services.lock
-r--r--r--    1 root     system         6968 Feb 28 2013  isoservices
-rw-r--r--    1 root     system       345386 May 08 11:02 services
-rw-r--r--    1 root     system       345314 May 08 11:00 services_backup_080519
bash-4.2#
Backup the inetd config
bash-4.2# cp /etc/inetd.conf /etc/inetd.conf_backup_080519
bash-4.2#
bash-4.2# ls -l /etc/ | grep inetd.conf
-rw-rw-r--    1 root     system         5134 Apr 12 2013  inetd.conf
-rw-r--r--    1 root     system         5134 May 08 11:02 inetd.conf_backup_080519
bash-4.2#
Edit the inetd config file
bash-4.2# vi /etc/inetd.conf
bash-4.2#
bash-4.2# ls -l /etc/ | grep inetd.conf
-rw-rw-r--    1 root     system         5200 May 08 11:05 inetd.conf
-rw-r--r--    1 root     system         5134 May 08 11:02 inetd.conf_backup_080519
bash-4.2#
Add the following config
## service  socket  protocol  wait/  user    server    server program
##  name     type             nowait         program     arguments
##

check_mk  stream tcp    nowait  root    /usr/bin/check_mk_agent

Check the file
bash-4.2# ls -l /etc/ | grep inetd.conf
-rw-rw-r--    1 root     system         5200 May 08 11:05 inetd.conf
-rw-r--r--    1 root     system         5134 May 08 11:02 inetd.conf_backup_080519
bash-4.2#
Restart the inetd services
bash-4.2# refresh -s inetd
0513-095 The request for subsystem refresh was completed successfully.
bash-4.2#
Check the check mk agent by telnet localhost 6556
bash-4.2# telnet localhost 6556
Trying...
Connected to loopback.
Escape character is '^]'.
<<<check_mk>>>
Version: 1.5.0p13
AgentOS: aix
Hostname: jasmine21
<<<df>>>
/dev/hd4 -           524288    436160     88128      84% /
/dev/hd2 -         13107200   2271228  10835972      18% /usr
/dev/hd9var -       2097152   1094380   1002772      53% /var

Jumat, 03 Mei 2019

How to clean haproxy-info log without restart with truncate command

  Tidak ada komentar
Check the disk size
[user@localhost log]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        94G   81G  8.9G  91% /
tmpfs           939M     0  939M   0% /dev/shm
/dev/sda1       488M  172M  291M  38% /boot
[user@localhost log]$
Check the size and inode number
[user@localhost log]$ ls -lshi | grep haproxy-info.log
2359684  72G -rwxrwxrwx  1 root   root    72G May  3 14:47 haproxy-info.log
[user@localhost log]$
Perform the truncate command
[user@locahost log]$ truncate -s 0 M haproxy-info.log
[user@localhost log]$
Check the size and inode number
[user@localhost log]$ ls -lshi | grep haproxy-info.log
2359684 220K -rwxrwxrwx  1 root   root   217K May  3 14:48 haproxy-info.log
[user@localhost log]$
The disk size have decrease
[user@localhost log]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        94G  8.9G   81G  10% /
tmpfs           939M     0  939M   0% /dev/shm
/dev/sda1       488M  172M  291M  38% /boot
[user@localhost log]$