<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Need one script to send E-mail. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-one-script-to-send-e-mail/m-p/2455885#M12469</link>
    <description>I need a simple script to send an E-mail based on some condition. This script I will put in crontab.&lt;BR /&gt;&lt;BR /&gt;I want to check if Oracle database is down, then send E-mail notification to DBA.&lt;BR /&gt;&lt;BR /&gt;For exaple:&lt;BR /&gt;&lt;BR /&gt;IF [ Database is Down] then&lt;BR /&gt;echo 'Message' |sendmail gulam@region.on&lt;BR /&gt;Endif&lt;BR /&gt;&lt;BR /&gt;We usually check if Oracle is up or down by&lt;BR /&gt;&lt;BR /&gt; $ps -ef|grep pmon&lt;BR /&gt;&lt;BR /&gt;If there is any oracle pmon process running, this command will show its details, so this means Oracle is up otherwise it is down.&lt;BR /&gt;&lt;BR /&gt;But I really don't know how to check this condition.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gulam.</description>
    <pubDate>Thu, 19 Oct 2000 23:24:11 GMT</pubDate>
    <dc:creator>Gulam Mohiuddin</dc:creator>
    <dc:date>2000-10-19T23:24:11Z</dc:date>
    <item>
      <title>Need one script to send E-mail.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-one-script-to-send-e-mail/m-p/2455885#M12469</link>
      <description>I need a simple script to send an E-mail based on some condition. This script I will put in crontab.&lt;BR /&gt;&lt;BR /&gt;I want to check if Oracle database is down, then send E-mail notification to DBA.&lt;BR /&gt;&lt;BR /&gt;For exaple:&lt;BR /&gt;&lt;BR /&gt;IF [ Database is Down] then&lt;BR /&gt;echo 'Message' |sendmail gulam@region.on&lt;BR /&gt;Endif&lt;BR /&gt;&lt;BR /&gt;We usually check if Oracle is up or down by&lt;BR /&gt;&lt;BR /&gt; $ps -ef|grep pmon&lt;BR /&gt;&lt;BR /&gt;If there is any oracle pmon process running, this command will show its details, so this means Oracle is up otherwise it is down.&lt;BR /&gt;&lt;BR /&gt;But I really don't know how to check this condition.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gulam.</description>
      <pubDate>Thu, 19 Oct 2000 23:24:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-one-script-to-send-e-mail/m-p/2455885#M12469</guid>
      <dc:creator>Gulam Mohiuddin</dc:creator>
      <dc:date>2000-10-19T23:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need one script to send E-mail.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-one-script-to-send-e-mail/m-p/2455886#M12470</link>
      <description>Try something like this..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# Author: Anthony Goonetilleke&lt;BR /&gt;# Desc: Monitor Oracle instances&lt;BR /&gt;######################################&lt;BR /&gt;&lt;BR /&gt;ORA_INSTANCES=24&lt;BR /&gt;CUR_ORA_INSTANCES=`ps -ef | grep -c pmon`&lt;BR /&gt;HOST=`/usr/bin/hostname`&lt;BR /&gt;MAIL="/usr/bin/mailx"&lt;BR /&gt;SUBJECT="Problem on ${HOST}: ${CUR_ORA_INSTANCES} Ora instances available"&lt;BR /&gt;RECIPIENTS="youremail@domain.com"&lt;BR /&gt;&lt;BR /&gt;if (( $CUR_ORA_INSTANCES &amp;lt; $ORA_INSTANCES )) &lt;BR /&gt;then&lt;BR /&gt; echo "You have an Oracle problem" | $MAIL -s"${SUBJECT}" $RECIPIENTS&lt;BR /&gt;else &lt;BR /&gt; echo "You dont have an Oracle problem" | $MAIL -s"All is well" $RECIPIENTS&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Oct 2000 23:44:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-one-script-to-send-e-mail/m-p/2455886#M12470</guid>
      <dc:creator>Anthony Goonetilleke</dc:creator>
      <dc:date>2000-10-19T23:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need one script to send E-mail.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-one-script-to-send-e-mail/m-p/2455887#M12471</link>
      <description>&lt;BR /&gt;Simply you can do like this:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# check about oracle database&lt;BR /&gt;&lt;BR /&gt;orac_chk=`ps -ef| grep pmon | grep -v grep`&lt;BR /&gt;&lt;BR /&gt;if [ ${#orac_chk} -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "oracle is DOWN" | mailx -s ?racle check"gulam@region.on&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;federico&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Oct 2000 06:28:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-one-script-to-send-e-mail/m-p/2455887#M12471</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2000-10-20T06:28:34Z</dc:date>
    </item>
  </channel>
</rss>

