Skip to content

Commit

Permalink
Merge pull request #15 from beechesII/master
Browse files Browse the repository at this point in the history
fix creation of mysql monitor
  • Loading branch information
lucasheld authored Feb 3, 2023
2 parents e1af0d6 + 03fe603 commit c0ed576
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/modules/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ def run(api, params, result):
params["databaseConnectionString"] = "Server=<hostname>,<port>;Database=<your database>;User Id=<your user id>;Password=<your password>;Encrypt=<true/false>;TrustServerCertificate=<Yes/No>;Connection Timeout=<int>"
elif params["type"] == MonitorType.POSTGRES:
params["databaseConnectionString"] = "postgres://username:password@host:port/database"
elif params["type"] == MonitorType.MYSQL:
params["databaseConnectionString"] = "mysql://username:password@host:port/database"

if not params["port"]:
if type == MonitorType.DNS:
Expand Down Expand Up @@ -351,7 +353,7 @@ def main():
module_args = dict(
id=dict(type="int"),
name=dict(type="str"),
type=dict(type="str", choices=["http", "port", "ping", "keyword", "dns", "docker", "push", "steam", "mqtt", "sqlserver", "postgres", "radius"]),
type=dict(type="str", choices=["http", "port", "ping", "keyword", "dns", "docker", "push", "steam", "mqtt", "sqlserver", "postgres", "mysql", "radius"]),
interval=dict(type="int"),
retryInterval=dict(type="int"),
resendInterval=dict(type="int"),
Expand Down Expand Up @@ -408,7 +410,7 @@ def main():
mqttTopic=dict(type="str"),
mqttSuccessMessage=dict(type="str"),

# SQLSERVER, POSTGRES
# SQLSERVER, POSTGRES, MYSQL
databaseConnectionString=dict(type="str"),
databaseQuery=dict(type="str"),

Expand Down

0 comments on commit c0ed576

Please sign in to comment.