mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge pull request #1422 from kvelarde/develop
First monit module commit
This commit is contained in:
commit
9d2a749319
44
salt/modules/monit.py
Normal file
44
salt/modules/monit.py
Normal 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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user