How to make Jenkins send email for an external test - email

I'm not entirely sure where to start. Someone told me I could have Jenkins monitor one of our web services and that if it detects the service is down, to have Jenkins send an email alerting us.
I created a "Monitor an external job" job in Jenkins. I setup the remote server to send the output of the monitoring script to this job name in Jenkins. We can see the results on the screen when it runs. The problem is, "Monitor external job" doesn't have the nice options that Freestyle job has, meaning, it doesn't let me select Email notification or what not for me to setup to send an email if the service is down.
Can anyone point me in the right direction? How do I get Jenkins to check the output of a remote job and send an email if it fails? Am I even going about this the right way? Is creating a "Monitor an external job" the correct way to solve this problem? What plugins, other than the email-ext plugin is required to do this job? Thanks in advance for your help.

I'm using http://wiki.jenkins-ci.org/display/JENKINS/HTTP+Request+Plugin to monitor whether some websites are up or down. You can set it to 'Fail the build' and set up a 'Post-build Action' 'Email Notification'.
Another option could be to setup an 'Execute shell' Build step, and curl a request to your web service, and check the response.

Related

Capturing error logs in the email notification while deploying through octopus deploy

I am using octopus deploy automation tool(V2020 1.14) for deploying my code.Email configuration through SMTP is already configured. Now while email is sent it should have the complete error log in case if deployment is failed at certain step. Could you please share me some thoughts how to do this ???
There's a couple of things you could do here but the first thing that comes to mind is this example here which logs the error and error detail for each step that failed in a deployment.
To extend this further you could add a link to the full deployment log in the email by using other Octopus system variables. To create a link to the deployment the email step is running I've created an example below.
#{Octopus.Web.ServerUri}/app#/#{Octopus.Space.Id}/projects/#{Octopus.Project.Id}/releases/#{Octopus.Release.Number}/deployments/#{Octopus.Deployment.Id}?activeTab=taskSummary
Hopefully, this answers your question but if you need further information let me know.

how pass email in jenkins in run time through Variable

I am facing below problem,Appreciate if any one help
I am having jenkin job which will trigger java jar contains code to read the email from excel and the same email to be passed in jenkins for sending email in username field.
Thanks
Did you take a look at parameterized jobs (If you want to manually trigger it)?
If, you want to read from excel and pass to another job please take a look at this.
I'm trying to understand your problem:
1. Jenkins to trigger emails to DevOps team that the deployment task results
2. Application to trigger emails that the application is being deployed successfully (Or any other scenarios you want to achieve, please indicate, and I will try to enhance this post)
If above is the case, you should try to utilize Jenkins to complete the full process: build, test, deploy and verify, then consolidate the results then send out via email
It's a clear cut that Jenkins for deployment and app for business
There are different ways to verify your application is deployed successfully depends on how you identify if app deployment is successful.
Jenkins can detect those signals, e.g. send a ping or curl to the application and verify the response
Now only Jenkins needs to know the list of emails address for the deployment results, you can use parameterized jobs as #Avneesh Srivastava mentioned

Do not send emails to subscribers in the Reporting Configuration. Kentico 9

After creating a subscription in the Reporting Configuration, the emails are not sent at the specified time, but if you perform any actions on the site, the emails will be sent. This is the problem of the virtual machine on which the site or IIS is deployed. Or does the feature Kentico.
Prompt in what there can be a problem and how the system of sending of emails inin the Reporting Configuration works.
This is a correct behavior. Kentico checks for e-mails that are to be sent at the end of requests which means that if there are no requests, no e-mails are sent. If you need some tasks to be send at a specified time, you need to use Windows scheduler and configure task (e-mmail sending) to use it. See official documentation for more detail.s
Another option to Enn's, is to use a service like UpTime Robot to continually visit your page (like every 5 minutes), this not only generates a request but also will help keep your site awake and from going to sleep if you can't manually set the Worker Processor to never go to sleep.
Windows Scheduler is the most reliable, but UpTime robot has worked well for us.
https://uptimerobot.com/
Under the "Scheduled Tasks" module there is a schedule task called "Report subscription sender". This task runs every minute and is responsible for checking your subscriptions and sending e-mails based on your configuration. This task runs within the Kentico instance. By default IIS will put the site/app pool to sleep after x (default 20) minutes of idle and the scheduled tasks are no longer able to run. When you hit the site it wakes the process back up and the scheduled task is able to run again. You can go into IIS and configure the "Idle Time-out (minutes)" for the application pool see this link https://patrickdesjardins.com/blog/iis-no-sleep-idle-and-autostart-with-values for a pretty good illustration. You can also adjust the app pool recycle intervals but that is probably not necessary for your issue.
The other option, as mentioned by Enn, is to install the Kentico Scheduler Windows service which always runs and configure that scheduled task to run in the service.

How to prevent hudson from sending multiple emails for cron job failures

I have a job in Hudson which monitors the environment.
The requirement is the job should get built periodically and send a mail when the env is down.
But it should stop sending mails if the status of the job in last run is fail and an email has already been sent. How to setup this trigger in Hudson?
First, if you aren't already doing so, you should be using email-ext plugin for sending emails.
Once that is installed, in your post-build actions, use "Editable Email Notification".
In there, click "Advanced..." button to setup triggers that control when (and to whom) and email is sent.
You need at least 2 triggers: Failure and Still Failing.
"Failure" will be triggered when the job fails for the first time. Send the email to everyone whom you want to include.
"Still Failing" will be triggered if there are subsequent failures. In this case, leave the recipient list unchecked (or send only to admin).
You can also use the Fixed trigger. This will send the email after the build recovers from failure (but not on subsequent successes)

Interactive service Logged in as user

So we are trying to setup a Continuous Integration server at my company. What we need to do is svn update the working copy on the server, then build it, start the site using IIS express and then run Watin/Specflow tests on it. I'm using rake inside of CCNet to automate all of this. We are running CCNet as a service and logging in as a build agent because svn uses our domain login credentials in order to authenticate. I've been unable to call the command line "svn update --username user --password pass" because of this. Yet Watin needs to be run in an interactive mode, and the service won't let me . I'm able to get it to work if we manually log on to the server and run ccnet as command line. Unfortunately the Build Agent also logs out of that user account, closing any command lines with it (I don't know why they need it to do this but they do). So is it possible to run a service in interactive mode if its signed in as a user?
If you have access to two servers you can build (can also work from computer to server)
Automated remote desktop - in windows form
see this post http://www.codeproject.com/Articles/43705/Remote-Desktop-using-C-NET
from one server to log into the server you need to run the Watin tests on and in the scheduled task, have the tests to come on after the log in has happened. This then gives the impression that the service is interacting with the desktop.
If you need any more information let me know