Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts

Thursday, 5 March 2020

How to include linux commands in scripts, effectively with echo command - Basic OS monitor script



#/bin/bash
echo hi!!! Naveen
echo
echo welcome to basic os monitoring script
echo
echo top 10 processes running now
top | head -10
echo
echo mount point size
df -h
echo
echo free memory in the system now
free -m
echo
echo output of uptime command
uptime
echo
echo io statistics
iostat
echo
echo

OUTPUT :

Hostname:/install # ./basic_mon.sh
hi!!! Naveen

welcome to basic os monitoring script

top 10 processes running now
top - 11:10:05 up 79 days,  2:20,  1 user,  load average: 0.19, 3.69, 3.22
Tasks: 425 total,   1 running, 424 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.3 us,  0.3 sy,  0.0 ni, 99.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:  13201688+total, 66643632 used, 65373244 free,   593712 buffers
KiB Swap: 20971516 total,    78036 used, 20893480 free. 29159464 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S   %CPU  %MEM     TIME+ COMMAND
 1962 root      20   0  425120   1596    508 S  6.250 0.001 331:15.05 tuned
20580 pl0adm    20   0 13.934g 9.828g 640468 S  6.250 7.806   8:37.73 hdbindexserver
27050 root      20   0   41340   3260   2208 R  6.250 0.002   0:00.02 top

mount point size
Filesystem                                   Size  Used Avail Use% Mounted on
/dev/xvda1                                    40G  4.8G   33G  13% /
devtmpfs                                      64G     0   64G   0% /dev
tmpfs                                        110G     0  110G   0% /dev/shm
tmpfs                                         64G  800K   64G   1% /run
tmpfs                                         64G     0   64G   0% /sys/fs/cgroup
/dev/xvdd                                    2.9G  771M  2.0G  28% /opt/bmc
/dev/xvdc                                    2.0G   21M  1.8G   2% /tmp
/dev/xvdb                                    2.0G  1.3G  536M  72% /var
/dev/xvde                                    7.8G  6.9G  471M  94% /usr/sap
:/vol1_XY0_PL0/q_sysfiles/sapmnt  100G   23G   78G  23% /sapmnt/PL0
:/vol2_XY0_PL0/q_dbdata           3.5G  1.9G  1.7G  52% /hana/data/PL0
:/vol1_XY0_PL0/q_sysfiles/db      100G   23G   78G  23% /usr/sap/PL0
:/vol3_XY0_PL0/PL0                1.0G  4.8M 1020M   1% /hana_backup/PL0/log
:/vol1_XY0_PL0/q_install          100G   23G   78G  23% /install
:/vol1_XY0_PL0/q_dbhome           100G   23G   78G  23% /sybase/PL0
:/vol3_XY0_PL0/HDB_PL0            1.0G  4.8M 1020M   1% /hana_backup/PL0/data
:/vol1_XY0_PL0/q_dblog            100G   23G   78G  23% /hana/log/PL0
:/vol1_XY0_PL0/q_sysfiles/hana    100G   23G   78G  23% /hana/shared/PL0
:/vol3_XY0_PL0/q_dbarch           1.0G  4.8M 1020M   1% /sybase/PL0/saparch_1
:/vol1_XY0_PL0/q_dbdump           100G   23G   78G  23% /sybase/PL0/shmdump
:/vol1_XY0_PL0/q_dblog            100G   23G   78G  23% /sybase/PL0/saplog_1

free memory in the system now
             total       used       free     shared    buffers     cached
Mem:        128922      65081      63841        607        579      28476
-/+ buffers/cache:      36025      92897
Swap:        20479         76      20403

output of uptime command
 11:10am  up 79 days  2:20,  1 user,  load average: 0.19, 3.69, 3.22

io statistics
Linux 3.12.74-60.64.107.1.17187.0.PTF.1126890-default (hec01v031100)    03/05/2020      _x86_64_        (40 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.72    0.00    0.29    0.01    0.00   98.97

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
xvda              1.39         2.06        20.03   14072349  136903676
xvdb             12.40         1.46        71.67    9971369  489811208
xvdc              0.69         0.09         8.26     623249   56442324
xvdd              0.07         0.38         0.28    2618305    1939448
xvde              0.63         1.66         4.22   11356101   28809664
xvdy              0.75         1.51         0.00   10313048          0
xvdz              0.19         1.16         2.43    7896116   16575008


Sunday, 19 May 2019

SAP HANA COCKPIT NOTES 26:How to trouble shoot hana cockpit issues

troubleshooting method 1:


If you encounter issues with SAP HANA cockpit, you can use XS CLI commands to view services logs and application status. You can execute the XS CLI commands on the machine where the cockpit is installed, using the <SID>adm account, or remotely using the XSA Client. For complete details on logging into the SAP HANA XS advanced runtime console and on the XS CLI: Application Management commands, see SAP HANA Developer Guide for SAP HANA XS Advanced Model. 

troubleshooting method 2:

You can investigate potential issues by viewing the log file of a specific service with the command                                                          xs logs <APP> 

where <APP> is the name of the application whose log-file details you want to display in XS apps cmd.


EX:
In the log of cockpit-collection-svc, if you see: A collection could not be submitted for execution because the worker thread pool is exhausted, then consider increasing the collection worker thread pool in the data collection settings through the cockpit manager. Increase the threads incrementally, rechecking the log each time, until the issue is resolved.

troubleshooting method 3: