Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Monitor the daily email volume of Exchange

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Goal: to count the number of emails sent and received in a specific cycle.

The solution is as follows:

Push the daily number of emails sent and received by each server to zabbix for monitoring. Push once a day, draw in zabbix, and the total amount of mail in a specific cycle can be obtained through the average * cycle in the figure.

Solution:

1. Use powershell to get the daily transceiver of each server, and zabbix_sender to zabbix server

two。 Create a scheduled task timed execution script

Resolution process:

The script is as follows:

Add-PSSnapin microsoft.exchange*$Server= "MBX1.liuxing.com", "MBX2.liuxing.com", "MBX03.liuxing.com", "MBX4.liuxing.com" MBX5.liuxing.com $today=get-date$ago=$today.AddDays (- 1) $from=$ago.ToString ("MM/dd/yyyy") $timeF= "$from 00:00:00" $timeE= "$from 23:59:59" $SCount=$RCount=$DSNCount=0foreach ($I in $Server) {$temp=Get-MessageTrackingLog-Server "$I"-Start "$timeF"-End "$timeE"-ResultSize unlimited foreach ($j in $temp) {if ($j.EventId-eq "RECEIVE"-and $j.Source-eq "STOREDRIVER") {$SCount++ } if ($j.EventId-eq "DELIVER") {$RCount++} if ($j.EventId-eq "DSN") {$DSNCount++} C:\ zabbix\ bin\ zabbix_sender.exe-z zabbix.liuxing.com-s $I-k sendcount-o $SCount C:\ zabbix\ bin\ zabbix_sender.exe-z zabbix.liuxing.com-s $I-k receivecount-o $RCount C:\ zabbix\ bin\ zabbix_sender.exe-z zabbix.liuxing.com-s $I-k dsncount-o $DSNCount}

Scheduled tasks:

Zabbix effect picture:

Because

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report