- vừa được xem lúc

[MAXIMO] - How to view SystemOut and SystemErr logs in Maximo App without accessing file server.

0 0 11

Người đăng: Võ Việt Hà

Theo Viblo Asia

Mục đích

Mục đích quản trị viên hệ thống Maximo có thể nhanh chóng xem các bản ghi bên trong Maximo để duy trì, hỗ trợ và bắt nhật ký ngay lập tức.

image.png

Giải pháp

Đây là giải pháp rất đơn giản để tải tệp Systemout và Systemerr từ nhật ký Maximo. Bạn có thể áp dụng ý tưởng của mình dựa trên điều này, chẳng hạn như: Tải xuống các tệp nhật ký trực tiếp để điều tra sau. Tôi sẽ demo để tải và hiển thị tệp nhật ký SystemOut. Bạn có thể làm điều này cho SystemRrr theo cùng một cách.

1. Database Configuration

Non-persistent Object:

Object Name: VIEWSYSTEMOUT
Persistent: No
Service: CUSTAPP

Non-persistent Attribute: (you can define more attributes for SystemErr)

Attribute Name: VIEWLOGS | Type: ALN | Length: 100 | Long Description Owner: Yes Attribute Name: VIEWLOGS_LONGDESCRIPTION | Type: LONGALN | Length: 32,000

2. Automation Scripts - Python

Launch Point:

LP Name: VIEWLOGS
Object: VIEWSYSTEMOUT
Events: Initialize Value

Python:

Script Name: S_VIEWLOGS

import os
#from psdi import Mbo def fetch_system_logs(): try: # Path to the log file log_file_path = "C:/IBM/WebSphere/AppServer/profiles/ctgAppSrv01/logs/MXServer/SystemOut.log" # Check if the file exists #if not os.path.exists(log_file_path): # return "Error: Log file not found." # Read the last 32000 lines with open(log_file_path, "r") as log_file: lines = log_file.readlines() return "".join(lines[-32000:]) # Last 32000 lines except Exception as e: return "Error reading logs" + str(e) # Fetch logs and populate the LOGCONTENT field
log_content = fetch_system_logs()
if mbo: #print("This is a debug message printed to SystemOut.log. " + mbo.getName()) mbo.setValue("VIEWLOGS_LONGDESCRIPTION", log_content)
else: service.log("MBO object is not available. Check the launch point.")

3. Application Designer

New Dialog:

<dialog id="viewsystemoutlog" label="View System Out Logs" mboname="VIEWSYSTEMOUT">
<multilinetextbox columns="100" dataattribute="VIEWLOGS_LONGDESCRIPTION" id="viewsystemoutlog_textbox" inputmode="readonly" label="SYSTEM OUT LOGS" rows="30"/>
<buttongroup id="viewsystemoutlog_btgroup">
<pushbutton default="true" id="viewsystemoutlog_btnok" label="OK" mxevent="dialogok"/>
</buttongroup>
</dialog>

SigOption:

Name: VIEWSYSTEMOUTLOG
Description: View System Out Logs

Select Action Menu:

Element Type: OPTION
Key Value: VIEWSYSTEMOUTLOG
Position: 0
Subposition: 999
Visible: Yes
Tabs: LIST

4. Security Settings

  • Security Group: MAXADMIN
  • Application: Database Configuration
  • Grant Access:

image.png

Bình luận

Bài viết tương tự

- vừa được xem lúc

Laravel file permission

Một trong những lỗi khó thường gặp khi cài đặt mới một dự án sử dụng Laravel framework đó là file permission denied. Bài viết này sẽ trình bày về một số nguyên nhân và giải pháp cho vấn đề kể trên.

0 0 66

- vừa được xem lúc

Improve performance by deleting laravel log file via Routes. (Artisan & exec)

1.Giới thiệu.

0 0 57

- vừa được xem lúc

Tìm hiểu về bộ công cụ quản lí log ELK (P2)

Các thành phần và chức năng của ELK Stack. 1. Các thành phần của ELK Stack. E = Elasticsearch.

0 0 48

- vừa được xem lúc

Phân tích log với Splunk (1)

1. Tấn công Brute Force. Chuẩn bị 2 máy ubuntu 20.04, 1 máy win 10 cùng card mạng NAT.

0 0 22

- vừa được xem lúc

Phân tích log với Splunk (2)

Cài đặt splunk trên win 11, đẩy log về server. Cài đặt và triển khai Splunk enterprise 10.0.0 trên máy Win11.

0 0 18

- vừa được xem lúc

Maximo Training

Techsolidity Maximo Training: Learn IBM Maximo, EAM, makes you an expert in building the applications by leveraging capabilities of Maximo. This training provides the skills needed to operate, maintai

0 0 16