Hello.
I'm trying to make working a custom trigger.
I want to save the id of the request into a mysql server when the request status change to Resolved.
The script is in python (3.5.2) and this is my code,
- import pymysql.cursors
- import sys
- # Connect to the database
- connection = pymysql.connect(host='192.168.1.120',
- user='root',
- password='root',
- db='idsdb',
- cursorclass=pymysql.cursors.DictCursor)
- try:
- with connection.cursor() as cursor:
- # Create a new record
- sql = "INSERT INTO `datos` (`id`) VALUES (%s)"
- cursor.execute(sql, (str(sys.argv[1])))
- # connection is not autocommit by default. So you must commit to save
- # your changes.
- connection.commit()
- finally:
- connection.close()
When I execute the script form the cmd of windows like this "python sos.py 2333", the data is inserted.
But with the Custom Trigger dosn´t work.
my script is in the next path "C:\ManageEngine\ServiceDesk\integration\custom_scripts\sos.py"
and this is my custom trigger configuration
What i´m doing wrong??