Recently notice that the Processor status in the Nagios host is always busy and the disk usage of the Var partition is also busy all the time:
1. Check the disk useage per process by command pidstat -dl 10
pidstat -dl 10 Linux 4.4.0-96-generic (monitoring) 10/26/2017 _x86_64_ (1 CPU) 09:53:50 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command 09:54:00 AM 1001 7014 -1.00 -1.00 -1.00 3 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg 09:54:00 AM 0 40886 -1.00 -1.00 -1.00 36 sendmail: MTA: ./v9P7j3UM010793 from queue 09:54:00 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command 09:54:10 AM 1001 7014 -1.00 -1.00 -1.00 1 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg 09:54:10 AM 0 40886 -1.00 -1.00 -1.00 27 sendmail: MTA: ./v9P5wjK6007289 from queue 09:54:10 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command 09:54:20 AM 1001 7014 -1.00 -1.00 -1.00 1 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg 09:54:20 AM 0 40886 -1.00 -1.00 -1.00 36 sendmail: MTA: ./v9P653Nx007507 from queue 09:54:20 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command 09:54:30 AM 1001 7014 -1.00 -1.00 -1.00 3 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg 09:54:30 AM 0 40886 -1.00 -1.00 -1.00 27 sendmail: MTA: ./v9P4Z3rs004474 from queue
Notice the sandmail is always sending emial from the queue, this may cause the constent disk reading.
2. check the mail queue by command mailq
mailq | more
MSP Queue status...
/var/spool/mqueue-client is empty
Total requests: 0
MTA Queue status...
/var/spool/mqueue (5792 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
v9PMmjLB040886 1930 Thu Oct 26 09:50 MAILER-DAEMON
(Deferred: Connection refused by monitoring.gscms.com.)
v9L7cjS6060543 1752 Sat Oct 21 19:38 MAILER-DAEMON
(Deferred: Connection refused by monitoring.gscms.com.)
v9L7Ij0o059984 1930 Sat Oct 21 18:21 MAILER-DAEMON
(Deferred: Connection refused by monitoring.gscms.com.)
v9LCcjbE004221 2025 Sat Oct 21 23:42 MAILER-DAEMON
(Deferred: Connection refused by monitoring.gscms.com.)
Total requests: 5792
3. Flush the mail queue
you want to tell sendmail to flush the mail queue, the command
sendmail -q -v