RHEL9 pmda-postfix での postfix の監視方法

環境
Red Hat Enterprise Linux release 9.2 (Plow)

概要
Performance Co-Pilot (PCP) は、システムレベルのパフォーマンス測定を監視、
視覚化、保存、および分析するためのツール、サービス、およびライブラリーのスイートです。

前提条件
PCP がインストールされている。
pmlogger サービスが有効になっている。

操作手順
1.以下のパッケージをインストールします。
pcp-system-tools をインストールします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf install pcp-system-tools
# dnf install pcp-system-tools
# dnf install pcp-system-tools

pmda-postfix パッケージをインストールして、postfix を監視します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf install pcp-pmda-postfix postfix
# dnf install pcp-pmda-postfix postfix
# dnf install pcp-pmda-postfix postfix

ロギングデーモンをインストールします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf install rsyslog
# dnf install rsyslog
# dnf install rsyslog

テスト用にメールクライアントをインストールします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf install mutt
# dnf install mutt
# dnf install mutt

2.postfix サービスおよび rsyslog サービスを有効にします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# systemctl enable postfix rsyslog
# systemctl restart postfix rsyslogs
# systemctl enable postfix rsyslog # systemctl restart postfix rsyslogs
# systemctl enable postfix rsyslog
# systemctl restart postfix rsyslogs

3.SELinux ブール値を有効にして、pmda-postfix が必要なログファイルにアクセスできるようにします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# setsebool -P pcp_read_generic_logs=on
# setsebool -P pcp_read_generic_logs=on
# setsebool -P pcp_read_generic_logs=on

4.PMDA をインストールします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cd /var/lib/pcp/pmdas/postfix/
# ./Install
Updating the Performance Metrics Name Space (PMNS) ...
Terminate PMDA if already installed ...
Updating the PMCD control file, and notifying PMCD ...
Waiting for pmcd to terminate ...
Starting pmcd ...
Check postfix metrics have appeared ... 7 metrics and 58 values
# cd /var/lib/pcp/pmdas/postfix/ # ./Install Updating the Performance Metrics Name Space (PMNS) ... Terminate PMDA if already installed ... Updating the PMCD control file, and notifying PMCD ... Waiting for pmcd to terminate ... Starting pmcd ... Check postfix metrics have appeared ... 7 metrics and 58 values
# cd /var/lib/pcp/pmdas/postfix/

# ./Install

Updating the Performance Metrics Name Space (PMNS) ...
Terminate PMDA if already installed ...
Updating the PMCD control file, and notifying PMCD ...
Waiting for pmcd to terminate ...
Starting pmcd ...
Check postfix metrics have appeared ... 7 metrics and 58 values

検証手順
1.pmda-postfix 操作を確認します。
echo testmail | mutt root

2.利用可能なメトリックを確認します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# pminfo postfix
postfix.received
postfix.sent
postfix.queues.incoming
postfix.queues.maildrop
postfix.queues.hold
postfix.queues.deferred
postfix.queues.active
# pminfo postfix postfix.received postfix.sent postfix.queues.incoming postfix.queues.maildrop postfix.queues.hold postfix.queues.deferred postfix.queues.active
# pminfo postfix

postfix.received
postfix.sent
postfix.queues.incoming
postfix.queues.maildrop
postfix.queues.hold
postfix.queues.deferred
postfix.queues.active

 

IT

Posted by arkgame