Answers: <p>You can use Build Periodically functionality under Build Triggers in Jenkins FreeStyle Job. (1)</p>
  
  <p>At the Bottom of the Job Configuration, there is also a BUILD Menu with "Add Build Step" and you can execute shell. (2)</p>
  
  <p>There is a POST BUILD Menu which you can use to send notifications once the build is done. (3)</p>
  
  <p>Depending on how you want things done, you can have the whole script in (2) instead of splitting it into (2) and (3). </p>
  
  <p><a href="https://i.sstatic.net/DdCN6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DdCN6.png" alt="enter image description here"></a></p>
  
  <p><a href="https://stackoverflow.com/questions/47758319/build-triggers-in-jenkins">https://stackoverflow.com/questions/47758319/build-triggers-in-jenkins</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2019-09-23T08:00:11.537Z
Answers: 2019-09-23T08:00:11.537Z
Answers: tnsh
Answers: <p>It's possible and pretty simple to do this with Jenkins. Here is a sample pipeline:</p>
  
  <pre class="lang-java prettyprint-override"><code>pipeline {
      agent any
  
      triggers {
          cron('*/5 * * * *')
      }
  
      stages {
          stage('Health checker') {
              steps {
                  sh 'curl https://mywebsite.com'
              }
  
              post {
                  failure {
                      mail to: 'notify-list@example.com',
                          from: 'jenkins@example.com',
                          subject: "${env.JOB_NAME} - Failed",
                          body: "Job Failed"
                  }
              }
          }
      }
  }
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2019-08-22T12:28:35.297Z
Answers: [No space, please](http://english.stackexchange.com/questions/4645/is-it-ever-correct-to-have-a-space-before-a-question-or-exclamation-mark#comment206109_4645).
Answers: Peter Mortensen
Answers: CC BY-SA 4.0
Answers: 2019-08-21T13:16:26.913Z
Answers: 2019-08-22T12:44:28.083Z
Answers: 2019-08-22T12:44:28.083Z
Answers: Hedi Nasr
Body: <p>I'm trying to set up a way to constantly monitor a website that is built and deployed via Jenkins. A simple curl command would tell me if everything is OK, but how I would set up a job to do this every ~10 minutes? </p>
  
  <p>Or would this be a bad idea?</p>
  
Tags: <jenkins>
Title: Can/should I use Jenkins to monitor whether a website is up and send out an email if it's down?
UserDisplayName: zta
ThreadText: # Can/should I use Jenkins to monitor whether a website is up and send out an email if it's down?
  
  (Asked by: username_0 on 2019-08-20)
  
  I'm trying to set up a way to constantly monitor a website that is built and deployed via Jenkins. A simple curl command would tell me if everything is OK, but how I would set up a job to do this every ~10 minutes?
  
  Or would this be a bad idea?
  
  **Tags:** jenkins
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-09-23. Score: 0 | Accepted answer
  
  You can use Build Periodically functionality under Build Triggers in Jenkins FreeStyle Job. (1)
  
  At the Bottom of the Job Configuration, there is also a BUILD Menu with "Add Build Step" and you can execute shell. (2)
  
  There is a POST BUILD Menu which you can use to send notifications once the build is done. (3)
  
  Depending on how you want things done, you can have the whole script in (2) instead of splitting it into (2) and (3).
  
  [![enter image description here](https://i.sstatic.net/DdCN6.png)](https://i.sstatic.net/DdCN6.png)
  
  <https://stackoverflow.com/questions/47758319/build-triggers-in-jenkins>
  
  
  ---
  
  ### Answer by username_2 on 2019-08-21. Score: 1
  
  It's possible and pretty simple to do this with Jenkins. Here is a sample pipeline:
  
  ```java
  pipeline {
      agent any
  
      triggers {
          cron('*/5 * * * *')
      }
  
      stages {
          stage('Health checker') {
              steps {
                  sh 'curl https://mywebsite.com'
              }
  
              post {
                  failure {
                      mail to: 'notify-list@example.com',
                          from: 'jenkins@example.com',
                          subject: "${env.JOB_NAME} - Failed",
                          body: "Job Failed"
                  }
              }
          }
      }
  }
  
  ```
  
  > **Comments:**
  > **username_3**: [No space, please](http://english.stackexchange.com/questions/4645/is-it-ever-correct-to-have-a-space-before-a-question-or-exclamation-mark#comment206109_4645).  
  
  ---
  
  