how to check server reachability using curl command?
<p>I am using curl command to hit the server. i am getting header body in response.if status=200 server is up.how do i write shell script to check whether my server is down and trigger the mail?</p>

<p>Command:</p>

<pre><code>curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "X-Auth-Token: token which is generated after login " -d "{
  \"authSource\": \"APKIRAI\",
  \"email\": \"username\",
  \"password\": \"password(xxx)\"}" "api url(login)"
</code></pre>

<p>Response:</p>

<pre><code>{"status":1,"message":"All is well","body":{"token":"anandkhot.actovoice@gmail.com:1:1467298960095:405a3dcd524cd673ebc4fd59a31fbabc","expires":1467298960095}}
</code></pre>