{"id":8870,"date":"2023-01-16T19:39:22","date_gmt":"2023-01-16T22:39:22","guid":{"rendered":"https:\/\/swiv.com.br\/?p=8870"},"modified":"2023-01-16T19:39:22","modified_gmt":"2023-01-16T22:39:22","slug":"how-to-install-and-configure-oswatcher-using-oracle-linux-rpm","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2023\/01\/16\/how-to-install-and-configure-oswatcher-using-oracle-linux-rpm\/","title":{"rendered":"How to Install and Configure OSWatcher Using Oracle Linux RPM"},"content":{"rendered":"\n<p>Al\u00e9m dos utilit\u00e1rios nativos a n\u00edvel de S.O, tamb\u00e9m podemos recorrer ao OSWatcher para nos ajudar em investiga\u00e7\u00f5es que precisem de indicadores previamente coletados, como CPU, mem\u00f3ria, I\/O, network, etc. Esta ferramenta realiza as coletas periodicamente e persiste as informa\u00e7\u00f5es em arquivos, que podem ser analisados posteriormente. Neste artigo vamos seguir o procedimento destacado nos Oracle Notes &#8220;<strong>Oracle Linux: How to Install and Configure OSWatcher Using RPM (Doc ID 2560609.1)<\/strong>&#8221; e &#8220;<strong>OS Watcher User&#8217;s Guide (Doc ID 1531223.1)<\/strong>&#8220;.<\/p>\n\n\n\n<p>Ambiente de laborat\u00f3rio:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 ~]# cat \/etc\/*release*\nOracle Linux Server release 7.7\nNAME=&quot;Oracle Linux Server&quot;\nVERSION=&quot;7.7&quot;\nID=&quot;ol&quot;\nID_LIKE=&quot;fedora&quot;\nVARIANT=&quot;Server&quot;\nVARIANT_ID=&quot;server&quot;\nVERSION_ID=&quot;7.7&quot;\nPRETTY_NAME=&quot;Oracle Linux Server 7.7&quot;\nANSI_COLOR=&quot;0;31&quot;\nCPE_NAME=&quot;cpe:\/o:oracle:linux:7:7:server&quot;\nHOME_URL=&quot;https:\/\/linux.oracle.com\/&quot;\nBUG_REPORT_URL=&quot;https:\/\/bugzilla.oracle.com\/&quot;\n\nORACLE_BUGZILLA_PRODUCT=&quot;Oracle Linux 7&quot;\nORACLE_BUGZILLA_PRODUCT_VERSION=7.7\nORACLE_SUPPORT_PRODUCT=&quot;Oracle Linux&quot;\nORACLE_SUPPORT_PRODUCT_VERSION=7.7\nRed Hat Enterprise Linux Server release 7.7 (Maipo)\nOracle Linux Server release 7.7\ncpe:\/o:oracle:linux:7:7:server\n&#x5B;root@oel7 ~]#\n<\/pre><\/div>\n\n\n<p>Instalando o pacote:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 etc]# wget https:\/\/yum.oracle.com\/repo\/OracleLinux\/OL7\/addons\/x86_64\/getPackage\/oswatcher-9.0.0-5.el7.noarch.rpm\n--2023-01-16 19:22:17--  https:\/\/yum.oracle.com\/repo\/OracleLinux\/OL7\/addons\/x86_64\/getPackage\/oswatcher-9.0.0-5.el7.noarch.rpm\nResolving yum.oracle.com (yum.oracle.com)... 104.83.13.243, 2a02:26f0:dd:181::2a7d, 2a02:26f0:dd:19d::2a7d\nConnecting to yum.oracle.com (yum.oracle.com)|104.83.13.243|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 53280 (52K) &#x5B;application\/x-rpm]\nSaving to: \u2018oswatcher-9.0.0-5.el7.noarch.rpm\u2019\n\n100%&#x5B;============================================================================================&gt;] 53,280       191KB\/s   in 0.3s\n\n2023-01-16 19:22:21 (191 KB\/s) - \u2018oswatcher-9.0.0-5.el7.noarch.rpm\u2019 saved &#x5B;53280\/53280]\n\n&#x5B;root@oel7 etc]#\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 etc]# ll *osw*\n-rw-r--r--. 1 root root 53280 Sep  8  2021 oswatcher-9.0.0-5.el7.noarch.rpm\n&#x5B;root@oel7 etc]# yum install oswatcher-9.0.0-5.el7.noarch.rpm\nLoaded plugins: langpacks, ulninfo\nExamining oswatcher-9.0.0-5.el7.noarch.rpm: oswatcher-9.0.0-5.el7.noarch\nMarking oswatcher-9.0.0-5.el7.noarch.rpm to be installed\nResolving Dependencies\n--&gt; Running transaction check\n---&gt; Package oswatcher.noarch 0:9.0.0-5.el7 will be installed\n--&gt; Finished Dependency Resolution\n\nDependencies Resolved\n\n======================================================================================================================================\n Package                    Arch                    Version                      Repository                                      Size\n======================================================================================================================================\nInstalling:\n oswatcher                  noarch                  9.0.0-5.el7                  \/oswatcher-9.0.0-5.el7.noarch                  234 k\n\nTransaction Summary\n======================================================================================================================================\nInstall  1 Package\n\nTotal size: 234 k\nInstalled size: 234 k\nIs this ok &#x5B;y\/d\/N]: y\nDownloading packages:\nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\nWarning: RPMDB altered outside of yum.\n\n  Installing : oswatcher-9.0.0-5.el7.noarch                                                                                       1\/1\n  Verifying  : oswatcher-9.0.0-5.el7.noarch                                                                                       1\/1\n\nInstalled:\n  oswatcher.noarch 0:9.0.0-5.el7\n\nComplete!\n&#x5B;root@oel7 etc]#\n<\/pre><\/div>\n\n\n<p>Editando arquivo de configura\u00e7\u00f5es (como \u00e9 apenas laborat\u00f3rio, deixei o per\u00edodo de reten\u00e7\u00e3o baixo):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 etc]# cat \/etc\/sysconfig\/oswatcher\n# The directory where oswatcher logs should be kept\nDATADIR=\/var\/log\/oswatcher\n# The interval (in seconds) between runs runs of statistics collections\nINTERVAL=30\n# The maximum age (in hours) of the various log files\nMAXAGE=4\n# An optional program used to compress the log files\nZIP=gzip\n&#x5B;root@oel7 etc]#\n<\/pre><\/div>\n\n\n<p>Inicializando o servi\u00e7o:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 etc]# systemctl start oswatcher\n&#x5B;root@oel7 etc]# systemctl status oswatcher\n\u25cf oswatcher.service - OSWatcher:set of scripts used to periodically collect OS and network metrics.\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/oswatcher.service; enabled; vendor preset: disabled)\n   Active: active (running) since Mon 2023-01-16 19:28:35 -03; 5s ago\n Main PID: 31518 (OSWatcher)\n    Tasks: 2\n   CGroup: \/system.slice\/oswatcher.service\n           \u251c\u250031518 \/bin\/sh \/usr\/sbin\/OSWatcher 30 4 gzip \/var\/log\/oswatcher\n           \u2514\u250031594 mpstat -P ALL 1 2\n\nJan 16 19:28:35 oel7.localdomain systemd&#x5B;1]: Started OSWatcher:set of scripts used to periodically collect OS and network metrics..\nJan 16 19:28:35 oel7.localdomain OSWatcher&#x5B;31518]: Info...Zip option IS specified.\nJan 16 19:28:35 oel7.localdomain OSWatcher&#x5B;31518]: Info...OSW will use gzip to compress files.\nJan 16 19:28:35 oel7.localdomain OSWatcher&#x5B;31518]: Changing current working directory to \/var\/log\/oswatcher\n&#x5B;root@oel7 etc]#\n<\/pre><\/div>\n\n\n<p>J\u00e1 \u00e9 poss\u00edvel ver a disposi\u00e7\u00e3o das pastas que abrigar\u00e3o os arquivos com as coletas realizadas:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 etc]# cd \/var\/log\/oswatcher\n&#x5B;root@oel7 oswatcher]# ll\ntotal 8\ndrwxr-xr-x. 21 root root 4096 Jan 16 19:28 archive\ndrwxr-xr-x.  2 root root  103 Jan 16 19:32 locks\n-rw-r--r--.  1 root root 1303 Jan 16 19:32 log\ndrwxr-xr-x.  2 root root   38 Jan 16 19:32 tmp\n&#x5B;root@oel7 oswatcher]# cd archive\/\n&#x5B;root@oel7 archive]# ll\ntotal 0\ndrwxr-xr-x. 2 root root  52 Jan 16 19:28 oswarp\ndrwxr-xr-x. 2 root root  58 Jan 16 19:28 oswbuddyinfo\ndrwxr-xr-x. 2 root root 104 Jan 16 19:28 oswcpuinfo\ndrwxr-xr-x. 2 root root  57 Jan 16 19:28 oswifconfig\ndrwxr-xr-x. 2 root root  55 Jan 16 19:28 oswiostat\ndrwxr-xr-x. 2 root root  56 Jan 16 19:28 oswmeminfo\ndrwxr-xr-x. 2 root root  55 Jan 16 19:28 oswmpstat\ndrwxr-xr-x. 2 root root  56 Jan 16 19:28 oswnetstat\ndrwxr-xr-x. 2 root root  58 Jan 16 19:28 oswnfsiostat\ndrwxr-xr-x. 2 root root   6 Jan 16 19:28 oswnumastat\ndrwxr-xr-x. 2 root root  57 Jan 16 19:28 oswpagetype\ndrwxr-xr-x. 2 root root  56 Jan 16 19:28 oswpidstat\ndrwxr-xr-x. 2 root root   6 Jan 16 19:28 oswprvtnet\ndrwxr-xr-x. 2 root root  51 Jan 16 19:28 oswps\ndrwxr-xr-x. 2 root root  57 Jan 16 19:28 oswslabinfo\ndrwxr-xr-x. 2 root root  52 Jan 16 19:28 oswtop\ndrwxr-xr-x. 2 root root  55 Jan 16 19:28 oswvmstat\ndrwxr-xr-x. 2 root root   6 Jan 16 19:28 oswxentop\ndrwxr-xr-x. 2 root root  57 Jan 16 19:28 oswzoneinfo\n&#x5B;root@oel7 archive]#\n<\/pre><\/div>\n\n\n<p>Entrando na pasta oswtop, percebemos que o arquivo \u00e9 alterado de tempos em tempos, conforme a periodicidade definida no arquivo de configura\u00e7\u00e3o:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 archive]# cd oswtop\n&#x5B;root@oel7 oswtop]# ll\ntotal 60\n-rw-r--r--. 1 root root 57859 Jan 16 19:35 oel7.localdomain_top_23.01.16.1900.dat\n&#x5B;root@oel7 oswtop]# date\nMon Jan 16 19:36:15 -03 2023\n&#x5B;root@oel7 oswtop]# ll\ntotal 60\n-rw-r--r--. 1 root root 57859 Jan 16 19:35 oel7.localdomain_top_23.01.16.1900.dat\n&#x5B;root@oel7 oswtop]# ll\ntotal 60\n-rw-r--r--. 1 root root 57859 Jan 16 19:35 oel7.localdomain_top_23.01.16.1900.dat\n&#x5B;root@oel7 oswtop]# ll\ntotal 60\n-rw-r--r--. 1 root root 57859 Jan 16 19:35 oel7.localdomain_top_23.01.16.1900.dat\n&#x5B;root@oel7 oswtop]# ll\ntotal 60\n-rw-r--r--. 1 root root 57895 Jan 16 19:36 oel7.localdomain_top_23.01.16.1900.dat\n<\/pre><\/div>\n\n\n<p>O conte\u00fado deste arquivo por exemplo \u00e9 o output do comando top:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nzzz ***Mon Jan 16 19:38:23 -03 2023\nTasks: 383 total,   1 running, 297 sleeping,   0 stopped,   0 zombie\n%Cpu(s):  1.3 us,  1.6 sy,  0.0 ni, 96.9 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st\nKiB Mem : 16150712 total,  8465304 free,  1526056 used,  6159352 buff\/cache\nKiB Swap:  1261564 total,  1261564 free,        0 used. 11256316 avail Mem\n\n  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND\n 5726 root      20   0  110256   2708   1964 S   6.7  0.0   0:00.15 pidstat\n 5749 root      20   0  163740   4644   3744 R   3.8  0.0   0:00.08 top\n 2965 grid      20   0 2574652 113756  67544 S   1.0  0.7   2:13.37 ohasd.bin\n 3375 grid      20   0 1042240  42164  30300 S   1.0  0.3   1:09.50 cssdagent\n 3642 grid      -2   0 1554232  64464  61232 S   1.0  0.4   3:03.47 asm_vktm_++\n 3762 oracle    -2   0 2983032  60736  57468 S   1.0  0.4   3:04.12 ora_vktm_c+\n16225 root      20   0  115164   3468   2832 S   1.0  0.0   0:06.29 bash\n    1 root      20   0  194096   8876   5808 S   0.0  0.1   0:09.79 systemd\n    2 root      20   0       0      0      0 S   0.0  0.0   0:00.02 kthreadd\n    4 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker\/0:+\n    6 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 mm_percpu_+\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Al\u00e9m dos utilit\u00e1rios nativos a n\u00edvel de S.O, tamb\u00e9m podemos recorrer ao OSWatcher para nos ajudar em investiga\u00e7\u00f5es que precisem de indicadores previamente coletados, como CPU, mem\u00f3ria, I\/O, network, etc. Esta ferramenta realiza as coletas periodicamente e persiste as informa\u00e7\u00f5es em arquivos, que podem ser analisados posteriormente. Neste artigo vamos seguir o procedimento destacado nos [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,6],"tags":[],"class_list":["post-8870","post","type-post","status-publish","format-standard","hentry","category-administration","category-linux"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=8870"}],"version-history":[{"count":0,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8870\/revisions"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=8870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=8870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=8870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}