Application Perf Mgmt (BAC / BSM) Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Running a script in remote computer

Occasional Advisor

Running a script in remote computer

Hi,

 

Here I am trying to check the smtp server sending email on a remote server requests. Here I am planning to run a script in the remote server. But how could I confirm, whether the smtp has send the mail successfully. experts please help.

 

 

6 REPLIES
Honored Contributor

Re: Running a script in remote computer

I have not done this before but I will try to help. You can use the mail monitor or create a batch file which has the commands to test the SMTP server and use script monitor to execute the script.

 

Telnet to Port 25 to Test SMTP Communication

 

More info: http://support.microsoft.com/kb/153119

 

Port 25 is the default port for SMTP. So you can also configure port monitor on this port to ensure that the server is able to accept requests. A service monitor to check POP3 service should also help you.

 

--Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Occasional Advisor

Re: Running a script in remote computer

Hi,

 

By using the mail monitor we cannot test the mail request from a remote server to the smtp server. So the only way is the remote script execution. But unfortunately am not expert in perl script. So could you please provide me the script, which will send dummy mails and recieve the response from smtp server. So from the response I can determine whether the mailing is successfull or not. 

 

Regards

Pradeep

Frequent Advisor

Re: Running a script in remote computer

[ Edited ]

f i understand your problem. MAPI will help you. 

 

You can login into ur account, send/delete/read mails.

 

 

vuser_init()
{
lr_start_transaction("Logon");

mapi_logon("Logon",

"hpbaer06",

"3R06",

LAST);

 

lr_end_transaction("Logon", LR_AUTO);

return 0;
}

 

   

Action()
{

char rc;
int i;

 

// Set to beginning, read & delete

lr_start_transaction("Delete_Mail");


do {

mapi_set_property_sz("Message ID","");

// Read mail
rc = mapi_read_next_mail("",
"Show=all", //
"Peek=True", // [Optional: default = False]
"Type=IPM",
LAST);
// Delete read mail
if (rc == LR_PASS) {
char *msg_id = mapi_get_property_sz("Message ID");
if ((msg_id) && (*msg_id))
{
char msg_arg[640];
sprintf(msg_arg,"id=%s",msg_id);
lr_output_message("Delete mail w/ %s ...",msg_arg);
mapi_delete_mail("",msg_arg,LAST);
}
}
} while (rc == LR_PASS);


lr_end_transaction("Delete_Mail", LR_AUTO);

 

 

 

Occasional Advisor

Re: Running a script in remote computer

HI,

 

I think the provided script will delete the read mail from the account only. I need a script which will send one mail and should get back a response from the smtp server. So from that response we can determine the status.

Honored Contributor

Re: Running a script in remote computer

Then you better use the utility blat and call this. Call the utility and write to log and and look for specific text which will tell you that message has been successfully received or not.

 

http://www.blat.net/

https://www.techsupportalert.com/content/send-email-windows-command-line.htm

 

--Sujith

 

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Highlighted
Frequent Advisor

Re: Running a script in remote computer

lr_start_transaction("Send_Mail");

mapi_send_mail("SendMail",

"To=h1@aaaao.nl",

"Subject=Email Testing from Script!",

"Body=Test Message! Please ignore.",

LAST);

lr_end_transaction("Send_Mail", LR_AUTO);

 

lr_start_transaction("Receive_Mail");

 

 

lr_start_transaction("Receive_Mail");

// Reset current message to beginning of mail box

i = 0;
mapi_set_property_sz("Message ID", "");


// Loop to read Inbox every 1s until mail arrives or during max 10mins

do {

lr_think_time(1); // Peek at next mail (don't mark it as read)

rc = mapi_read_next_mail("", "Show=all", "Peek=False", LAST);

i++;


} while ((rc == LR_FAIL) && (i < 600));


// Define transaction success if there is a mail received in mailbox


if (rc == LR_PASS) lr_end_transaction("Receive_Mail", LR_PASS);

else lr_end_transaction("Receive_Mail", LR_FAIL);

 

you might need to login before sending mail...........

 

Hope it ll help