Monday, September 9, 2013

How to send mail using sendmail command

Hi All,

Before doing this make sure you have installed Sendmail on your malchine.

Now here the question is how to check whether the Sendmail is installed on your machine. If you are
using Linux Environment then please use the below command to identify the Sendmail availability.
$rpm -qa | grep sendmail
if you show some output as some sendmail rpm package name then it seems like it is installed.
You can cross refer the same using below command
$man sendmail
Now all set to go...
1) Create a file as xyz.sendmail
2) open and write 'xyz@example.com' in first line of file xyz.sendmail. Now this line indicate that 'xyz@example.com' is the receiver of this mail
3) open and write 'xyz@gmail.com' in second line of file xyz.sendmail. Now this line indicate that 'xyz@gmail.com' is mark as Cc in this mail.
4) open and write any valid "Subject" you want to mention for this mail in third line of file xyz.sendmail.
5) open and write BODY or Contents of your mail from fourth line onwords of file xyz.sendmail.
6) Once done, use the command as "sendmail -t < xyz.sendmail"

Please make sure that, your machine doesn't have any open relays otherwise your system become blacklisted so that then onwords you can't drop any mails. Also your system should have a fully qualified domain name and having DNS entry. This is must since the mail is going from your machine and 'From' field in the mail should be your machine domain name.

I hope this help you while programming means sending mails through script and also an alternative for mailx command.

Thanks & Regards
Vaibhav Wadkar

How to check whether the Autosys is up or down on your machine

Hi All,

I have provided some brief introduction about Autosys in my previous post.

In this post I will discuss about how to check whether Autosys is up or down on your machine. Suppose your machine name is "example.com". If you have Linux / Unix system then try below command on your machine

$ hostname

Once you got the machine name, try to execute below commands
$chk_auto_up

This command Verifies status of the  Unicenter  AutoSys  JM Scheduler and database. It determines if the Event Server (database) and the  scheduler are running. This is the utility you can use for debugging of Autosys. The output of this command is as below.

Logon to 201.32.02.19 - example.com (XYZ)
 chk_auto_up  
______________________________________________________________________________
CAUAJM_I_50054 Attempting (1) to Connect with Database: XYZ
CAUAJM_I_50055 *** Have Connected successfully with Database: XYZ. ***
______________________________________________________________________________
CAUAJM_I_50128 Connected with Event Server: XYZ
______________________________________________________________________________
______________________________________________________________________________
CAUAJM_I_50038 Checking CA Unicenter AutoSys JM Scheduler on Machine: example.com
CAUAJM_I_50044 Primary Scheduler is RUNNING on machine: example.com
______________________________________________________________________________
There is another command too which we can use while checking whether the Autosys is up or down.
Please use the below command to test.

$autoping -m example.com -A -D

This command verifies the connectivity  of  Unicenter  AutoSys Job Management (JM) server and client machines. This command also help us in debugging of Autosys. Here option -m stands for machine name, option -A sends an alarm when if any problem is detected, option -D check  the  database connections on the specified machine. Below shows the output of the command.

$autoping -m example.com -A -D
CAUAJM_I_50023 AutoPinging Machine [example.com] 
CAUAJM_I_50028 AND checking the Agent's DB Access.
CAUAJM_I_50025 AutoPing WAS SUCCESSFUL!

These are the heavily used Autosys command while debugging Autosys command. I hope this hope will help you while fixing Autosys.

Thanks & Regards
Vaibhav Wadkar