What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Restart windows server upon receiving email alert

Votes:

0

Here is the scenario, I have synthetic script for user login transaction created using selenium and configured it in Jenkins tool. Jenkins executes this script every 10 minutes and if user login transaction fails , it sends an email alert to the team saying script failed which means users are unable to login to the application.

Once I receive email I would manually login to the application server and restart it to fix the login failures.

Now I want to automate this process. Is it possible to send this email alert from Jenkins to PRTG so that upon receiving this email alert PRTG would restart the windows application server automatically?

alerts notification-email restart-service windows-2012-r2

Created on Jul 2, 2015 11:58:28 PM



9 Replies

Accepted Answer

Votes:

0

Hi there,

You can for example use the IMAP Sensor and enable Process Email Content to filter for the mail of interest. Enable the Sensor Behavior > Set to error > If... to set the sensor into an error state as soon as the email arrives.

Afterwards, you will need to create a script to restart the service on the remote machine. Please have a look at This Article for some ideas and examples.

Finally, create a new notification and choose the script for the Execute EXE/Script option and add a new State Trigger to the IMAP sensor.

Best regards

Created on Jul 3, 2015 8:32:46 AM by  Felix Saure [Paessler Support]



Votes:

0

Hello ,

Thanks for the reply. I understand that using IMAP sensor I can let the PRTG know to look for specific email with specific subject if they match it should restart the target remote server by using the script. So here how do I send Jenkins alert email to PRTG ? Do you have any detail steps to achieve this. Appreciate your reply

Created on Jul 3, 2015 7:29:03 PM



Votes:

0

Hello Felix

Thanks for the reply. I'm newbie to PRTG and would like to implement this tool in our network. Could you let me know the step by step how to achieve this. I understand that first we need to create a IMAP sensor for the email account. I'm using gmail to receive the alerts emails. Once I set up IMAP sensor then I have to set up notification and choose the script for the Execute EXE/Script option . Sounds like I understood but when trying to set up I'm confused.

Created on Jul 4, 2015 2:44:08 PM



Votes:

0

Hi,

What exactly did you already configure? Does the IMAP sensor work and did you enable the Sensor Behavior > Set to error > If... option?

Created on Jul 6, 2015 5:38:21 AM by  Felix Saure [Paessler Support]



Votes:

0

Yes, I successfully configured IMAP sensor and it's working . I created a restart vb script and placed inside EXE folder and configured this restart script under notification trigger section. but when the status becomes down ,the restart vb script is not getting triggered.

In the notification settings I have given target restart machine credentials as well. PRTG core server and target Machine sever both are windows 2012 R2.

I believe custom restart script is the culprit here. Could you provide me a custom restart script I will adapt it to our requirements and use it.

Created on Jul 6, 2015 11:44:45 AM



Votes:

0

Hi,

So you already managed to perform most of the required steps. The next step will be to execute the script manually from your PRTG host. If this works, check the

Logs > System Events > Notifications log files and see if the script is triggered successfully. You might also enter credentials for an administrative user in the notification settings, as the default System Account might not have sufficient rights to execute the script.

Best regards

Created on Jul 7, 2015 6:44:10 AM by  Felix Saure [Paessler Support]



Votes:

0

I have given 2 notifcation triggers 1) to send an email 2) restart the server.

In the notification logs , I see " Cannot connect to MX servers for address *@gmail.com.

Created on Jul 7, 2015 6:30:34 PM



Votes:

0

Hi, I am kind of confused as I would not expect Cannot connect to MX servers at this point, please check if the option Execute EXE/Script is enabled and that the Send Email option is not marked. Did you already try to execute the script manually?

Created on Jul 8, 2015 5:10:29 AM by  Felix Saure [Paessler Support]



Votes:

0

we got it fixed. Thanks for your inputs.

Created on Jul 16, 2015 2:31:20 PM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.