Merge pull request #1422 from kvelarde/develop

First monit module commit
This commit is contained in:
Jeff Schroeder 2012-06-30 14:00:20 -07:00
commit 9d2a749319

44
salt/modules/monit.py Normal file
View File

@ -0,0 +1,44 @@
'''
Monit service module. This module will create a monit type
service watcher.
'''
import os
def start(name):
'''
CLI Example::
salt '*' monit.start <service name>
'''
cmd = "monit start {0}".format(name)
return not __salt__['cmd.retcode'](cmd)
def stop(name):
'''
Stops service via monit
CLI Example::
salt '*' monit.stop <service name>
'''
cmd = "monit stop {0}".format(name)
return not __salt__['cmd.retcode'](cmd)
def restart(name):
'''
Restart service via monit
CLI Example::
salt '*' monit.restart <service name>
'''
cmd = "monit restart {0}".format(name)
return not __salt__['cmd.retcode'](cmd)