Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Configure automatic script in windows server Post 302617887 by Mohammed Fareed on Tuesday 3rd of April 2012 08:15:20 AM
Old 04-03-2012
Seems Issue is in the blat mail sending, manually I tried its not working details given below.
Please advice.

I have given the email correct, here i put "xx"Please advice.
Code:
C:\blat182_b>blat -to fareedm@xxx.xx -subject ""SQL Server process not runni
ng"" -body ""SQL Server process not running""", 1, True
-to does not exist

My Task List:-

Code:
 
C:\blat182_b>tasklist
Image Name                   PID Session Name     Session#    Mem Usage
========================= ====== ================ ======== ============
System Idle Process            0 Console                 0         28 K
System                         4 Console                 0        240 K
smss.exe                     648 Console                 0        444 K
csrss.exe                    696 Console                 0      4,752 K
winlogon.exe                 724 Console                 0      3,864 K
services.exe                 768 Console                 0      3,660 K
lsass.exe                    780 Console                 0      2,128 K
svchost.exe                  956 Console                 0      5,640 K
svchost.exe                 1024 Console                 0      4,820 K
MsMpEng.exe                 1120 Console                 0     45,216 K
svchost.exe                 1156 Console                 0     30,956 K
svchost.exe                 1248 Console                 0      3,780 K
svchost.exe                 1368 Console                 0      4,204 K
spoolsv.exe                 1540 Console                 0      5,072 K
svchost.exe                 1716 Console                 0      3,924 K
tomcat5.exe                 1852 Console                 0    146,180 K
svchost.exe                 1876 Console                 0      3,116 K
svchost.exe                 1896 Console                 0      3,092 K
winvnc4.exe                 2036 Console                 0      3,788 K
WLIDSVC.EXE                  228 Console                 0     12,564 K
YahooAUService.exe           548 Console                 0      6,220 K
CcmExec.exe                  596 Console                 0     29,844 K
wmiprvse.exe                 256 Console                 0      5,920 K
wmiprvse.exe                2488 Console                 0      5,384 K
WLIDSVCM.EXE                2552 Console                 0      2,252 K
explorer.exe                2616 Console                 0     21,908 K
hkcmd.exe                    604 Console                 0      3,604 K
igfxpers.exe                 632 Console                 0      3,232 K
msseces.exe                 2480 Console                 0     13,216 K
igfxsrvc.exe                3268 Console                 0      3,472 K
SearchProtection.exe        3284 Console                 0      1,504 K
ctfmon.exe                  3304 Console                 0      4,152 K
Ymsgr_tray.exe              4016 Console                 0      5,952 K
OSPPSVC.EXE                 3504 Console                 0     10,704 K
notepad.exe                 3904 Console                 0      2,000 K
OUTLOOK.EXE                 1296 Console                 0     17,208 K
firefox.exe                 2268 Console                 0    124,400 K
plugin-container.exe        2528 Console                 0     41,948 K
notepad.exe                 2276 Console                 0        452 K
mstsc.exe                    444 Console                 0      2,356 K
putty.exe                   1424 Console                 0        940 K
putty.exe                   1460 Console                 0        996 K
iexplore.exe                2216 Console                 0      2,788 K
iexplore.exe                2416 Console                 0     53,204 K
notepad.exe                 2156 Console                 0        648 K
plugin-container.exe        3528 Console                 0     10,292 K
cmd.exe                     2116 Console                 0        896 K
iexplore.exe                2316 Console                 0    121,044 K
notepad.exe                 2648 Console                 0      4,024 K
tasklist.exe                2212 Console                 0      4,708 K
wmiprvse.exe                1508 Console                 0      6,056 K

My code:-

Code:
dim WshShell
dim f,fso,Filename
Const ForReading = 1
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
'run the command and redirect
WshShell.Run "cmd /c tasklist.exe |sort > C:\\tlist.txt", 2, True
Filename = "C:\\tlist.txt"
Set f = fso.OpenTextFile(FileName, ForReading, True)
FileText = f.ReadAll
f.close
IF InStr(FileText,"oracle.exe") = 0 Then
 'Trigger the email - use blat or bmail utility
 Set WshShell = WScript.CreateObject("WScript.Shell")
 WshShell.Run "C:\\blat182_b\\blat -to fareedm@xxx.xx -subject ""SQL Server process not running"" -log blat.log -body ""SQL Server process not running""", 1, True
 'clear out wshshell variable
 set wshShell = Nothing
END IF
msgbox Found
WScript.Quit

Mohammed Fareed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automatic FTP Script from windows to unix machine

Hi i need to FTP files from windows to unix(sun) machine using script. what are the scripts commands i need to use to transfer files Thanks (2 Replies)
Discussion started by: bmkreddy
2 Replies

2. Solaris

Script for automatic deletion of trash file of mail server

Hi, I have a mail server with limited space and operating system is sun solaris 8 (sparc). I do not have provisions to increase the space for home directory. So i have to delete files from /home/username/mail/trash which are more than 10 days old automatically. So my script should be like... (1 Reply)
Discussion started by: crown2100bd
1 Replies

3. UNIX for Dummies Questions & Answers

Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server

I have a .sh script which was running fine on all the UNIX Servers (AIX, SunSolaris). The script requires two mandatory parameters and many optional parameters. Now at a different client place who are on a Windows Server, when I try to execute the script through MKS Toolkit, there are couple of... (5 Replies)
Discussion started by: madhunk
5 Replies

4. Linux

How to configure linux to receive snmp traps from a windows server?

Can anybody please tell me how to configure linux to receive snmp traps from a windows server? I am not able to receieve snmp traps on unix machines specifically linux and solaris. I have tried starting snmptrapd service on linux but it didn't work. Is there anything special that I have to do on... (2 Replies)
Discussion started by: iamtulipin
2 Replies

5. AIX

Do I need to configure my local windows to FTP files from local windows to a UNIX AIX server?

Hi Friends, I have this script for ftping files from AIX server to local windows xp. #!/bin/sh HOST='localsystem.net' USER='myid_onlocal' PASSWD='mypwd_onlocal' FILE='file.txt' ##This is a file on server(AIX) ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies

6. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

7. Programming

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.

I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning. The script is called cwrmail.pl and is located in my cgi-bin. When I... (9 Replies)
Discussion started by: BigBobbyB
9 Replies

8. Ubuntu

Automatic update script issue (Ubuntu server)

Hi, I've created a very basic script to run apt-get update and apt-get dist-upgrade unattended (run with cron) and save the logs. Though, it's not really a script, just a file containing the commands to run in order: pasteit .com/18601 I'm currently testing this and ran into some unexpected... (4 Replies)
Discussion started by: Raxje
4 Replies

9. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

10. Linux

How to connect Linux server (configure two way authentication) with Windows server?

Hi my name is Manju. ->I have configure the two way authentication on my linux server. ->Now I am able to apply two way authenticator on particuler user. ->Now I want to map this linux server to my AD server. ->Kindly tell me how to map AD(Active Directory) with this linux server. ... (0 Replies)
Discussion started by: manjusharma128
0 Replies
All times are GMT -4. The time now is 06:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy