BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Martin_Kolberg
Obsidian | Level 7

 

Hi,

 

I recognized that the Default Task LogfileArchive running command sas-archive will only create 22Bytes log-2018xxx.zip files and will not swipe out related log-default directories.

 

See:

[sas@sasviya viya]$ pwd
/var/log/sas/viya
[sas@sasviya viya]$ ls -l | grep zip
-rw-r--r-- 1 sas         sas  22 10. Dez 13:07 log-20181110120702Z.zip
-rw-r--r-- 1 sas         sas  22 11. Dez 04:00 log-20181111030000Z.zip
-rw-r--r-- 1 sas         sas  22 12. Dez 04:00 log-20181112030000Z.zip
-rw-r--r-- 1 sas         sas  22 13. Dez 04:00 log-20181113030000Z.zip
-rw-r--r-- 1 sas         sas  22 14. Dez 04:00 log-20181114030000Z.zip
-rw-r--r-- 1 sas         sas  22 14. Dez 13:38 log-20181114123815Z.zip
-rw-r--r-- 1 sas         sas  22 14. Dez 15:06 log-20181114140611Z.zip
[sas@sasviya viya]$

-rw-r--r-- 1 sas         sas  22 14. Dez 15:06 log-20181114140611Z.zip

 

Manually running sas-archive with install user sas, will also create 22 Bytes zip-files.

 

Q: What's wrong? Or do I missing something?

 

ENV:

SAS Viya 3.4 SMP on Linux CentOS 7.

24 Cores / 96RAM

 

Thank you in advanced

Martin Kolberg

1 ACCEPTED SOLUTION

Accepted Solutions
12 REPLIES 12
alexal
SAS Employee

@Martin_Kolberg,

 

Those are empty files. LogfileArchive runs at 4 AM every day. Its purpose is ZIP and archive all log files located in /opt/sas/viya/config/var/log that are not open have not been modified for 30 days.

 

What do you see in an output from a command below?

 

find /opt/sas/viya/config/var/log -mtime -30 -name "*log"

 

Also, please check the most recent log file in /opt/sas/viya/config/var/log/ops-agent/default directory. Any errors there?

Martin_Kolberg
Obsidian | Level 7

@alexal,  Thxs

 

…I see a lot of files. Please find attched the output of your comment

 

find /opt/sas/viya/config/var/log -mtime -30 -name "*log" > ~/find_output_community.txt

 

Also I see errors inside sas-ops-agent_xxx.logs

 

RabbitMQ is not available...

 

Ideas?


[sas@sasviya default]$ cat sas-ops-agent_2018-12-14_14-43-48.log
2018-12-14T14:43:58.434360+01:00 INFO  [xllogr.go:157] [ops-agent] - sas-ops-agent Log wurde gestartet für Server ops-agent Version 1.4.62-samarium Datum 2018-06-21 19:43:43Z auf Host sasviya.icasus
2018-12-14T14:43:58.434563+01:00 INFO  [xmmain.go:304] [ops-agent] - Log wurde gestartet für ops-agent Diensttyp cluster auf Host-System sasviya.icasus
2018-12-14T14:43:58.434779+01:00 INFO  [xmmain.go:345] [ops-agent] - Warten auf Consul- und Rabbit-Zugriff
2018-12-14T14:43:58.534040+01:00 WARN  [sas-ops-agent.go:23] [ops-agent] - RabbitMQ ist nicht verfügbar: keine Instanzen des [rabbitmq]-Diensts sind verfügbar
2018-12-14T14:44:09.103755+01:00 INFO  [xmmain.go:360] [ops-agent] - Consul-Basisschlüssel config wird verwendet
2018-12-14T14:44:09.249747+01:00 INFO  [xmmain.go:452] [ops-agent] - Ausführungsdatum: 2018-12-14T14:44:09.249699013+01:00, Host: sasviya.icasus, Diensttyp: cluster
2018-12-14T14:44:09.250007+01:00 INFO  [xmmain.go:496] [ops-agent] - Laden der Task-Konfiguration aus Consul-Basisschlüssel: config/ops-agent/tasks/
2018-12-14T14:44:19.441508+01:00 INFO  [xmconsul.go:113] [ops-agent] - getConsulLockName [error:<nil> name:ops-agent lock:true]
2018-12-14T14:44:19.884291+01:00 INFO  [xmconsul.go:217] [ops-agent] - getConsulTaskListHeader [host:sasviya.icasus servtype:cluster role:VIYA icount:1]
2018-12-14T14:44:20.111978+01:00 INFO  [xmconsul.go:122] [ops-agent] - freeConsulLockName [error:<nil> name:ops-agent]
2018-12-14T14:44:20.112145+01:00 INFO  [xmconsul.go:292] [ops-agent] - freeConsulLockName [error:<nil> name:ops-agent]
2018-12-14T14:44:20.112515+01:00 INFO  [xmmain.go:517] [ops-agent] - Es wurden 13664 von  in Tasklise eingelesen
2018-12-14T14:44:20.117163+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CASMetrics wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.117355+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CheckCpu wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.117418+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CheckFileSystemLinux wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.117479+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CheckFileSystemWindows wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.117549+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CheckMemory wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.117629+01:00 INFO  [xmexec.go:77] [ops-agent] - Task EmiSweeper wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.117701+01:00 INFO  [xmexec.go:77] [ops-agent] - Task FileSystemMetrics wird gestartet mit Ausführungstyp periodic_aligned
2018-12-14T14:44:20.117794+01:00 INFO  [xmexec.go:77] [ops-agent] - Task HostEnvSnapshot wird gestartet mit Ausführungstyp start_after
2018-12-14T14:44:20.117872+01:00 INFO  [xmexec.go:77] [ops-agent] - Task LogfileArchive wird gestartet mit Ausführungstyp time
2018-12-14T14:44:20.117942+01:00 INFO  [xmexec.go:77] [ops-agent] - Task NetworkInterfaceMetrics wird gestartet mit Ausführungstyp periodic_aligned
2018-12-14T14:44:20.118033+01:00 INFO  [xmexec.go:77] [ops-agent] - Task OpsAgentActivity wird gestartet mit Ausführungstyp periodic_aligned
2018-12-14T14:44:20.118096+01:00 INFO  [xmexec.go:77] [ops-agent] - Task OpsAgentTaskStatistics wird gestartet mit Ausführungstyp periodic_aligned
2018-12-14T14:44:20.118177+01:00 INFO  [xmexec.go:77] [ops-agent] - Task OpsArm wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.118243+01:00 INFO  [xmexec.go:77] [ops-agent] - Task PostgresMetrics wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.118314+01:00 INFO  [xmexec.go:77] [ops-agent] - Task RabbitmqMetrics wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.118389+01:00 INFO  [xmexec.go:77] [ops-agent] - Task SpringBootMetrics wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.118582+01:00 INFO  [xmexec.go:77] [ops-agent] - Task SpringBootMetricsLevel3 wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.118664+01:00 INFO  [xmexec.go:77] [ops-agent] - Task SystemMetrics wird gestartet mit Ausführungstyp periodic_aligned
2018-12-14T14:44:20.118782+01:00 INFO  [xmexec.go:77] [ops-agent] - Task TopProcessMetrics wird gestartet mit Ausführungstyp periodic_aligned
2018-12-14T14:44:20.118881+01:00 INFO  [xmexec.go:77] [ops-agent] - Task registerOpsAgentServiceTask wird gestartet mit Ausführungstyp periodic
2018-12-14T14:44:20.119005+01:00 INFO  [xmexec.go:77] [ops-agent] - Task registerOpsServiceTask wird gestartet mit Ausführungstyp periodic
[sas@sasviya default]$ cat sas-ops-agent_2018-11-15_16-24-01.log
2018-11-15T16:24:09.681128+01:00 INFO  [xllogr.go:157] [ops-agent] - sas-ops-agent Log wurde gestartet für Server ops-agent Version 1.4.62-samarium Datum 2018-06-21 19:43:43Z auf Host sasviya.icasus
2018-11-15T16:24:09.681351+01:00 INFO  [xmmain.go:304] [ops-agent] - Log wurde gestartet für ops-agent Diensttyp cluster auf Host-System sasviya.icasus
2018-11-15T16:24:09.681530+01:00 INFO  [xmmain.go:345] [ops-agent] - Warten auf Consul- und Rabbit-Zugriff
2018-11-15T16:24:09.820182+01:00 WARN  [sas-ops-agent.go:23] [ops-agent] - RabbitMQ ist nicht verfügbar: keine Instanzen des [rabbitmq]-Diensts sind verfügbar
2018-11-15T16:24:30.635478+01:00 INFO  [xmmain.go:360] [ops-agent] - Consul-Basisschlüssel config wird verwendet
2018-11-15T16:24:41.101516+01:00 INFO  [xmconsul.go:113] [ops-agent] - getConsulLockName [error:<nil> name:ops-agent lock:true]
2018-11-15T16:25:13.737790+01:00 INFO  [xmconsul.go:122] [ops-agent] - freeConsulLockName [name:ops-agent error:<nil>]
2018-11-15T16:25:13.800817+01:00 INFO  [xmconsul.go:511] [ops-agent] - freeConsulLockName [name:ops-agent error:<nil>]
2018-11-15T16:25:13.804128+01:00 INFO  [xmmain.go:452] [ops-agent] - Ausführungsdatum: 2018-11-15T16:25:13.80411137+01:00, Host: sasviya.icasus, Diensttyp: cluster
2018-11-15T16:25:13.804377+01:00 INFO  [xmmain.go:496] [ops-agent] - Laden der Task-Konfiguration aus Consul-Basisschlüssel: config/ops-agent/tasks/
2018-11-15T16:25:24.030381+01:00 INFO  [xmconsul.go:113] [ops-agent] - getConsulLockName [lock:true error:<nil> name:ops-agent]
2018-11-15T16:25:24.534523+01:00 INFO  [xmconsul.go:217] [ops-agent] - getConsulTaskListHeader [role:VIYA icount:1 host:sasviya.icasus servtype:cluster]
2018-11-15T16:25:24.775137+01:00 INFO  [xmconsul.go:122] [ops-agent] - freeConsulLockName [name:ops-agent error:<nil>]
2018-11-15T16:25:24.775330+01:00 INFO  [xmconsul.go:292] [ops-agent] - freeConsulLockName [name:ops-agent error:<nil>]
2018-11-15T16:25:24.775698+01:00 INFO  [xmmain.go:517] [ops-agent] - Es wurden 13664 von  in Tasklise eingelesen
2018-11-15T16:25:24.779102+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CASMetrics wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.779224+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CheckCpu wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.779314+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CheckFileSystemLinux wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.779399+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CheckFileSystemWindows wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.779484+01:00 INFO  [xmexec.go:77] [ops-agent] - Task CheckMemory wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.779571+01:00 INFO  [xmexec.go:77] [ops-agent] - Task EmiSweeper wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.779670+01:00 INFO  [xmexec.go:77] [ops-agent] - Task FileSystemMetrics wird gestartet mit Ausführungstyp periodic_aligned
2018-11-15T16:25:24.779762+01:00 INFO  [xmexec.go:77] [ops-agent] - Task HostEnvSnapshot wird gestartet mit Ausführungstyp start_after
2018-11-15T16:25:24.779848+01:00 INFO  [xmexec.go:77] [ops-agent] - Task LogfileArchive wird gestartet mit Ausführungstyp time
2018-11-15T16:25:24.779967+01:00 INFO  [xmexec.go:77] [ops-agent] - Task NetworkInterfaceMetrics wird gestartet mit Ausführungstyp periodic_aligned
2018-11-15T16:25:24.780064+01:00 INFO  [xmexec.go:77] [ops-agent] - Task OpsAgentActivity wird gestartet mit Ausführungstyp periodic_aligned
2018-11-15T16:25:24.780151+01:00 INFO  [xmexec.go:77] [ops-agent] - Task OpsAgentTaskStatistics wird gestartet mit Ausführungstyp periodic_aligned
2018-11-15T16:25:24.780236+01:00 INFO  [xmexec.go:77] [ops-agent] - Task OpsArm wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.780321+01:00 INFO  [xmexec.go:77] [ops-agent] - Task PostgresMetrics wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.780405+01:00 INFO  [xmexec.go:77] [ops-agent] - Task RabbitmqMetrics wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.780489+01:00 INFO  [xmexec.go:77] [ops-agent] - Task SpringBootMetrics wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.780590+01:00 INFO  [xmexec.go:77] [ops-agent] - Task SpringBootMetricsLevel3 wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.780676+01:00 INFO  [xmexec.go:77] [ops-agent] - Task SystemMetrics wird gestartet mit Ausführungstyp periodic_aligned
2018-11-15T16:25:24.780762+01:00 INFO  [xmexec.go:77] [ops-agent] - Task TopProcessMetrics wird gestartet mit Ausführungstyp periodic_aligned
2018-11-15T16:25:24.780854+01:00 INFO  [xmexec.go:77] [ops-agent] - Task registerOpsAgentServiceTask wird gestartet mit Ausführungstyp periodic
2018-11-15T16:25:24.780976+01:00 INFO  [xmexec.go:77] [ops-agent] - Task registerOpsServiceTask wird gestartet mit Ausführungstyp periodic
[sas@sasviya default]$

Martin_Kolberg
Obsidian | Level 7

 

Again,

 

please clarify your reply:

 

You worte:

"Those are empty files. LogfileArchive runs at 4 AM every day. Its purpose is ZIP and archive all log files located in /opt/sas/viya/config/var/log that are not open have not been modified for 30 days."

 

Question:

"Does that mean the zip-file will only collect log-files which are older than 30 days?"

 

Like:

find /opt/sas/viya/config/var/log -mtime +30 -name "*log"

>>Which return an empty list in my case.

 

Or did I understand it wrong?

 

If correct, is it possible to adjust this?

 

Best Regards
Martin

 

 

alexal
SAS Employee

@Martin_Kolberg,

Does that mean the zip-file will only collect log-files which are older than 30 days?

Yes.

If correct, is it possible to adjust this?

Less than 30 days?

Martin_Kolberg
Obsidian | Level 7

Again,

 

I found https://blogs.sas.com/content/sgf/2018/06/06/log-management-in-sas-viya-3-3/

 

Which state that you can run sas-archive -age 3, which in my case inculdes log-files inside the log-2018xxxx.zip file, now.

 

/opt/sas/viya/home/bin
[sas@sasviya bin]$ ./sas-archive -age 3

 

 

[sas@sasviya log]$ pwd
/opt/sas/viya/config/var/log
-rw-r--r-- 1 sas         sas        22 10. Dez 13:07 log-20181110120702Z.zip
-rw-r--r-- 1 sas         sas        22 11. Dez 04:00 log-20181111030000Z.zip
-rw-r--r-- 1 sas         sas        22 12. Dez 04:00 log-20181112030000Z.zip
-rw-r--r-- 1 sas         sas        22 13. Dez 04:00 log-20181113030000Z.zip
-rw-r--r-- 1 sas         sas        22 14. Dez 04:00 log-20181114030000Z.zip
-rw-r--r-- 1 sas         sas        22 14. Dez 13:38 log-20181114123815Z.zip
-rw-r--r-- 1 sas         sas        22 14. Dez 15:06 log-20181114140611Z.zip
-rw-r--r-- 1 sas         sas  14235482 14. Dez 16:19 log-20181211151908Z.zip

To conclude I need to adjust the tasks.json to fit a shorter time-frame than 30 days, correct?

 

Best Regards
Martin

 

alexal
SAS Employee

@Martin_Kolberg,

 

That is correct. You can either change a command or add commandArgs.

Martin_Kolberg
Obsidian | Level 7
Question: is there a List of commands available for sas-archive?
alexal
SAS Employee

@Martin_Kolberg,

 

Sure. The sas-archive command accepts the following flags and arguments:

help

Print the help for sas-archive and exit.
version

Print version information for sas-archive and exit.
-age days
Archive and delete files with last modified time greater than days. (default 30)
-fileregex regular expression
A regular expression for selecting files from the directory to archive. (default ^.*\.log$)
<directory>
Archive files from this directory location. (default "/opt/sas/viya/config/var/log")

alexal
SAS Employee

@Martin_Kolberg,

 

My pleasure. Let me know if you have any other questions.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Discussion stats
  • 12 replies
  • 4162 views
  • 0 likes
  • 2 in conversation