Script Master 15 : First step towards proactive problem management in your IT environment.​

Script Master 15 : First step towards proactive problem management in your IT environment.​

Hello users,

 

Hope you all are well. Excited to connect with you once again through this post. Last week, we discussed on periodically notifying technicians about the pending requests. This week, it is going to be for all the busy firefighters of the IT infrastructure, the techs who operate in reactive mode and yearn for a proactive problem management.

 

So today's script focuses on analyzing the data (nature of the request) and alarms the technicians about frequently raised requests' category, and sub-category.. This may help the technicians to proactively start their investigation in finding the underlying root cause, and take necessary precautionary measures to ensure that others are not affected further.

This script works with the 'custom schedules' feature released in ServiceDesk Plus version 9300.

Execution steps:

 

1. Install Python on the ServiceDesk Plus server by following the below instructions.

https://www.youtube.com/watch?v=fUWFe4hmbIM

 

2. Once installed, download the ScheduledNotify.py script from the below link and place it in the ManageEngine/ ServiceDesk/ integration/custom_scripts folder.


http://bonitas2.zohocorp.com/zipUploads/2017_16_03_18_22_30_o_1bbbik08g7do11an1pkdpn04nh1.tar.gz


3. Edit the scheduleNotify.py file and update your SMTP server details, mail server name, username, and password. Also, specify the count of requests as a threshold and the email address to which the notification should be triggered. 


4. Go to Reports--> New Query Report and execute the below query and save it with the name "requests by category" under any of the available report folders.


The below query will fetch you the number of requests created from a specific category, subcategory, and item.


For MSSQL database:

 

select top 1 cd.categoryname 'category', scd.name 'subcategory', i.name 'item', count(wo.workorderid) 'count' from workorder wo left join workorderstates wos on wo.workorderid=wos.workorderid left join categorydefinition cd on wos.categoryid=cd.categoryid left join subcategorydefinition scd on wos.subcategoryid=scd.subcategoryid left join itemdefinition i on wos.itemid=i.itemid where wo.createdtime >= <from_today> and wo.createdtime <= <to_today> and wo.IS_CATALOG_TEMPLATE='0' group by cd.categoryname, scd.name, i.name

order by 4 desc

 

For PgSQL database:

 

select cd.categoryname "category", scd.name "subcategory", i.name "item", count(wo.workorderid) "count" from workorder wo left join workorderstates wos on wo.workorderid=wos.workorderid left join categorydefinition cd on wos.categoryid=cd.categoryid left join subcategorydefinition scd on wos.subcategoryid=scd.subcategoryid left join itemdefinition i on wos.itemid=i.itemid where wo.createdtime >= <from_today> and wo.createdtime <= <to_today> and wo.IS_CATALOG_TEMPLATE='0' group by cd.categoryname, scd.name, i.name

order by 4 desc limit 1 


5. Go to Admin--> Custom Schedules and set up the schedule as shown below.




6. When the script triggers, it will invoke the report and fetch the category, subcategory, and item of the requests raised and email the details to the configured email address.

 

7. Here's a sample of the email which the user will receive.




 

So do you still think firefighting IT issues going to help your IT? We are open to your suggestions or requirements for similar intelligent notifications that will yield great values to your IT team. You can count on us that it will be on our upcoming Script Master posts if that's feasible.

 

See you next week! 

                New to ADManager Plus?

                  New to ADSelfService Plus?