FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Sidebar


Top     SiteMap

Manager Server

Target Server

$FHHOME/bin/xxx.sh | xxxx.exp













.

middleware:postfix:index.html



This is an old revision of the document!


Top#Middleware Management

Postfix (postfix.py)

Postfix Operation

$ fab -l |grep postfix

$ fab  -H auht.pro  postfix.yum_install

Ref. Remote Shell Commands

$ H=test-server-1,test-server-2

$ fab  -H $H auth.pro  -- "ps aux |grep postfix"

$ fab  -H $H auth.pro  -- sudo systemctl status postfix
$ fab  -H $H auth.pro  -- sudo systemctl restart postfix


postfix.py

$FHHOME/fabfile/postfix.py

import sys
from fabric.api import *
from fabric.contrib import files
 
#----------------------------------------------------------------------
# Installing Postfix
#----------------------------------------------------------------------
# postfix.install_yum
@task
def install_yum():
    sudo("rpm -q postfix        > /dev/null 2>&1 || yum -y install postfix")


#----------------------------------------------------------------------
# Queue
#----------------------------------------------------------------------
# postfix.check_queue_num
@task
def postfix.check_queue_num():
    """ls /var/spool/mqueue | wc -l"""
    #sudo("mailq")
    sudo("ls /var/spool/mqueue | wc -l")



Postfix Configuration



middleware/postfix/index.html.1517060837.txt.gz ยท Last modified: 2018/01/27 22:47 by kurihara