In Linux, metric indicators are sent to the internal mailbox, and metric emails in linux are sent.
Database health monitoring is a very important task. An important indicator/KPI monitoring result has a dedicated collection, monitoring, and alarm system for relevant tasks.
Some indicators that are not very important or are still in the design and debugging phase, I just want to send them to my own mailbox. This article describes the process of configuring mail to send monitoring data on the server.
The server version is RHEL 6.2:
[Pg @ gtlions ~] # Cat/etc/issue
Red Hat Enterprise Linux Server release 6.2 (Santiago)
Kernel \ r on an \ m
Disable related servers:
[Root @ gtlions etc] # service sendmail stop
[Root @ gtlions etc] # service postfix stop
[Root @ gtlions etc] # service sendmail status
Sendmail stopped
Sm-client stopped
[Root @ gtlions etc] # service postfix status
Master stopped
The next step is important. By default, the SMTP used by the server cannot send emails to the internal mailbox of the enterprise organization. Therefore, you need to configure the mailbox information of the enterprise organization:
[Root @ gtlions etc] # tail/etc/mail. rc
# For Linux and BSD, this shoshould be set.
Set bsdcompat
Set from = [Sender's email address]
Set smtp = [smtp server address]
Set smtp-auth-user = [email user name]
Set smtp-auth-password = [email password]
Set smtp-auth = login
Manually test the email sending function:
[Root @ gtlions etc] # echo hello world | mail-s "test" gtlions@lai.com
[Root @ gtlions etc] # python dbcheck. py> dbcheck.txt; cat dbcheck.txt | mail-s dbcheckgtlions@lai.com
[Root @ gtlions etc] # python dbcheck. py> dbcheck.txt; mail-s dbcheckgtlions@lai.com <dhcheck.txt
[Root @ gtlions etc] # python dbcheck. py | mail-s dbcheck gtlions@lai.com
Shell script for sending emails:
[Pg @ gtlions] $ cat/home/pg/PycharmProjects/dbcheck. sh
#! /Bin/sh
./Etc/profile
.~ /. Bash_profile
Python/home/pg/PycharmProjects/dbcheck. py | mail-s "dbcheck 'date + % f'' % t'" gtlions@lai.com
Set the scheduled task and CRON calls the shell script:
[Pg @ gtlions] $ crontab-l
*/1 ***** sh/home/pg/PycharmProjects/dbcheck. sh 1>/home/pg/check. log 2> & 1
-EOF-
How to call monitoring content and send it to your mailbox or another computer // detailed steps
Monitoring computer I recommend you try computer monitoring experts.
Computer monitoring experts can not only record all keyboard input, QQ chat, MSN Chat record viewing and Internet monitoring, but also regularly screen computers, record the websites that open a window and browse.
{AskUser} You can also disable opening specified Windows and programs, running chat software, downloading software (thunder, BT, etc.) and game software. If you try to open or run these banned windows and programs, they will be immediately closed and recorded.
In addition, the software can send all monitoring information (keyboard input records, screens, etc.) to your designated mailbox, allowing you to easily implement network monitoring. After the software is installed, no trace is left and the hotkey startup method is used to monitor the computer you want to monitor without knowing it.
What do you think about this software? If you think you can search for computer monitoring experts on Baidu and then download and try it out.
What indicators and operation commands are used for Linux system monitoring?
Ps top.