Service failure automation script

Hi All,
I have configured the below mentioned code on our prod servers services to send email notifications when ever a service fails. 
On Error Resume Next
strComputer = "USDFW16AS61"
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
'Function block to dynamically retrieve the file size of the report file.
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Authentication type used for SMTP server.
'We are currently using 0, cdoAnonymous
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
'Creates message subject, we are using variables declared earlier in the script
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "CMS Production service iwutild is stopped"
'Sets the From address
objMessage.From = """Support DL"[email protected]
'Sets the destination, or TO address
objMessage.To = [email protected]
'Sets the CC address. Only used for testing purpose at the moment. Should be commented out when in use.
'objMessage.CC = ""
'Sets the message body, the actual email message. Variables are used in the message which was declared earlier.
objMessage.TextBody = "Dear Administrators, the xyz service is now in STOPPED state." & vbCRLF & vbCRLF & "Please do not reply to this message as it was sent to you by an automated Script."& vbCRLF & vbCRLF &
"Thanks and regards"
'objMessage.TextBody = "Dear Application Administrators,"  & vbCRLF & ""& vbCRLF & ""& vbCRLF &
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "servername"
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoAnonymous
'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = ""
'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = ""
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
'Sends the message using code.
objMessage.Send
This script is able to send notification only for the respective service that I have configured it to Run upon failure.
My requirement now is that the script should be able to detect out of the 6 app services that are down & should append the email body with the name of that service & send an email.
I understand Wscript.argument(0) can be of use but not able to use it. Could you kindly help?
Thanks,
Pankaj
P.S: I am not a developer, so kindly bear with me :)
Pankaj Dhoot

Hi Pankaj,
To solve the script issue, I would like to recommend you to post in the Visual Studio Languages forum for more effective support:
http://social.msdn.microsoft.com/Forums/en-US/home?category=vslanguages
or The Official Scripting Guys Forum!
http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG&filter=alltypes&sort=lastpostdesc
Thank you for your understanding.

Similar Messages

  • Is there a way to launch an app and a set of actions on startup? (Like an automator-script for ipad)

    Hi all,
    Is there a way to have the ipad execute a series of tasks at startup? (like an automator-script)
    Thank you!

    Hi all,
    For all you who have been looking for a solution for the problem above, here it is :
    http://www.kioskproapp.com/
    The Kiosk Pro app allows you to run any html-scrip locally stored on the ipad!
    Which is great! Because not only does it allow for an infinite amount of possibilities next to the video-looping, it also keeps on working with one click after a reboot!
    The learning curve of usage is quite simple for the problem above, since they provide extensive information on the website and have great customer service.
    I am very very happy I found this app, and I really hope this post saves a lot of people the headaches I've suffered in the course of finding the solution.
    Enjoy!
    Alex

  • Using a SecureString password in an automated script?

    Hello all,
    I've been having issues getting a secure string to work with an automated script.
    Basically, a piece of software we use can accept commands via powershell/command shell but requires a password for the commands to be run.
    I've spent a fair amount of time researching the ConvertFrom and ConvertTo methods and tried without success. (When trying to use the ConvertFrom/To methods the software gives back incorrect password errors).
    Can anyone please assist?

    Hi Jonathan,
    you can simply use the $SecurePassword variable from Basty's example (if you need a secure string) and pass this as Password. Please note though, this will only work if the account writing the credentials to file is also the same account used to read it
    from file.
    If you need to encode it for another account (like local system), you can use the
    Encrypt-Credential function-script (The example on how to retrieve a clear-text password in memory will also work with Basty's $cred object).
    On a final note:
    Encrypted or not, try to avoid writing passwords down if you can somehow avoid it. If possible, assign permissions to the account running the task, if the service you are accessing supports windows authentication and privileges.
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Automation scripts for Instant client install\ add TNS entry

    Guys,
    I'm trying to develop an VB application,which uses data from an Oracle server residing in my neighbour's system.
    My system doesn't have oracle client installed.
    So, I've made use of Oracle Instant Client package-OCBC.
    Now, I'm looking for an automation script that would do the following in order
    1)Uzip the instant client into a directory. (say C:\ondemand\instantclient)
    2)Add this directory into the PATH environment variable
    3)Set up Service Names with tnsnames.ora ie. Create a TNSNAMES.ORA file to configure my Oracle instance connection.
    4)Set the TNS_ADMIN environment variable to be the path to the tnsnames.ora
    Can someone help me out with automated scripts?
    Thanks,
    Bhagat

    Don't worry. I've solved it.
    One of the files I was using stated: Always set the TNS_ADMIN environment variable or registry setting to the full path of the tnsnames.ora file.
    I took that to mean including the "tnsnames.ora". It doesn't. It really does mean just the PATH part.
    However, with this corrected, I got the pulldown populated. But with only the first part of the name, from the tnsnames.ora file. tnsnames.ora had mydb.<domain>.com. The pulldown only had mydb. Manually adding the .<domain>.com to it worked.
    Now on to the next problem. <GRIN>
    Cheers,
    Eddie

  • New reminder service with Automator

    Hello,
    I'm stuck on trying to set up a service using Automator which would allow me to add a new reminder basically from anywhere in OSX:
    I used "ask for text", followed by "new reminder item"; but I'd like it to let me add a due date and time/reminder time. Does anyone have an idea how to do that?

    you need to use an automator variable and then it works.
    make a new service in automator which accepts files and folders and works in finder.
    the workflow in the service should be as follows
    1. ask for finder items.
    in this action ask for the destination folder to move items TO. control-click on that action and choose "ignore input".
    add a new storage variable to the workflow and set the next action to be
    2. set variable value.
    this will store the destination folder in that variable.
    3. add a dummy action to break the workflow chain. many things will work for this. for example, you can add a "run shell script" action which should be completely empty.
    4. get selected finder items
    5. move finder items
    drag the storage variable you made to the "TO" field in that action.
    save the service.

  • Problem in uploading attachment files through automation scripts using Oracle Application Testing Suite(OATS)

    I am using OATS tool for writing automation scripts to test a web-based application . But I am facing problem when the requirement is to upload any file from the system to that web application .
    Actually the behavior of the script or I guess of OATS is inconsistent as the attachment file is getting upload sometime and
    fails to do so at the other time .
    I have observed a strange case also ,i.e whenever i am executing the scripts while sharing my system screen on webex meeting
    then the attachment upload results in failure . What can be the proper solution for doing file upload using automation script ??

    Can you please check whether the sync has been taken care before performing the upload operation. If the sync is taken care then the upload should work always

  • Writing commands to get specific data channels in the output report via script or automated script generation..

    In my project I have to make certain calculation and then get the data plotted in the given report template. I am using automated script for this. My script is doing all the calculations and then it not selecting and drag-dropping the selected channels on the report template. Its saving the blank report template.
    I am struggling to get the data for specific channels plotted by using the script. I need the selected channels to be plotted on this report template and then get it saved.
    Any help will be deeply appreciated. Thanks
    Solved!
    Go to Solution.

    Hi LaxG,
    Brad is absolute right. It is possible to create your whole layout via script.
    If you have loaded  the example report layout you can copy these lines to create a new line in your plot. This is the recommended object oriented way.
    call Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Add(e2DShapeLine, "anyName")
    Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape.XChannel.Reference               = "[1]/Zeit"
    Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape.YChannel.Reference               = "[1]/Geschwindigkeit"
    For performance reasons it's recommended to use the it like this.
    dim oLine
    set oLine = Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape
    oLine.XChannel.Reference               = "[1]/Zeit"
    oLine.YChannel.Reference               = "[1]/Geschwindigkeit"
    Like Brad mentioned it is much easier, that you have a stored template of your report with all setings and customisations already done.
    You open this layout file and have stored the names of your calculated channels. When you are doing this with a script they always have the same name and belong to the same group.
    Now you can customize the references of the line items.
    Kind Regards,
    Philipp K.
    AE | NI Germany

  • SCCM 2012 SP1 - Offline Servicing failure - Failed to find or access the update binaries to be applied on the image

    Hi there
    Trying to patch a new Windows 7 SP1 image within SCCM 2012 SP1, but it's failing.
    I've searched for information on the failure messages I am seeing, but although there is a LOT of information online concerning Offline Servicing failures, I can't find anything on the errors I am seeing.
    I've tried injecting a single update, five updates and ten updates, no difference, same messages.
    We have McAfee Access Protection disabled, as we know Offline Servicing simply won't work if this is running.
    In the console, in Schedule Update Status for the image I am trying to update, the following message is shown:
    "Failed to find or access the update binaries to be applied on the image."
    That sounds as if the process can't find the actual .cab file for any update I've tried to inject, but I don't know why it wouldn't be able to do that, we have Software Updates configured and the .cab files are on the same server.
    When I looked at the OfflineServicingMgr.log file, I see the following entries:
    Processing image at index 1        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:52:49        8272 (0x2050)
    Mounting image at index 1. Image file='D:\ConfigMgr_OfflineImageServicing\PackageID\W7_Image.wim', MountDirectory='D:\ConfigMgr_OfflineImageServicing\PackageID\ImageMountDir', ImageFileType='WIM', Mode='ReadWrite'        SMS_OFFLINE_SERVICING_MANAGER       
    14/06/2014 14:52:49        8272 (0x2050)
    Image OS information : MajorVersionMS = 6, MinorVersionMS = 1, MajorVersionLS = 7601, MinorVersionLS = 17514        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:53:31       
    8272 (0x2050)
    Failed to find properties of file 4        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:53:31        8272 (0x2050)
    UnMounting Image (Commit Changes = 0) ...        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:53:31        8272 (0x2050)
    Completed processing image package PackageID. Status = Failed        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:54:04        8272 (0x2050)
    Updated history for image package PackageID in the database        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:54:04        8272 (0x2050)
    Schedule processing failed        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:54:04        8272 (0x2050)
    Processing completed for Schedule with ID 16777237        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:54:04        8272 (0x2050)
    STATMSG: ID=7910 SEV=E LEV=M SOURCE="SMS Server" COMP="SMS_OFFLINE_SERVICING_MANAGER" SYS=SCCMServer.domain SITE=Site_Code PID=8560 TID=8272 GMTDATE=Sat Jun 14 13:54:04.964 2014 ISTR0="16777237" ISTR1="" ISTR2=""
    ISTR3="" ISTR4="" ISTR5="" ISTR6="" ISTR7="" ISTR8="" ISTR9="" NUMATTRS=0        SMS_OFFLINE_SERVICING_MANAGER       
    14/06/2014 14:54:04        8272 (0x2050)
    Schedule processing thread stopped        SMS_OFFLINE_SERVICING_MANAGER        14/06/2014 14:54:05        8272 (0x2050)
    I'm not sure what file "Failed to find properties of file 4" is referring to, whether dism.exe, an update or the image itself, but immediately after this message appears the image is unmounted. After that this message shows:
    "Completed processing image package PackageID. Status = Failed"
    As I say, there's a lot of information available re Offline Servicing but I haven't found anything with these particular messages.
    If anyone has encountered this before, I'd appreciate any information you have.
    Regards,
    John.

    Hi,
    I think file named 'NO_SMS_ON_DRIVE.SMS’ might be causing this issue. If this file is present in logical drives, then please give it a shot one more time after deleting this file from the logical drives.
    Due to this file, it might be preventing 'smsexec' service to skip the drive when looking for content. So worth a try!
    After deleting this file, you also need to restart 'smsexec' service to reflect the changes. You can also verify from below registry value & ensure that all of your logical drives (specially where SCCMContentLib directory resides) should be listed
    over there 
    'HKLM\Software\Microsoft\SMS\DP\ContentLibUsableDrives'
    Hope this will help!
    Cheers | Navdeep Sidhu

  • An error occcurred on line 105 while executing script 'MOM Backward Compatibility Service State Monitoring Script"

    We've been getting the following error for some time now.
    An error occurred on line 105 while executing script 'MOM Backward Compatibility Service State Monitoring Script'
    Source: Microsoft VBScript runtime error
    Description: The remote server machine does not exist or is unavailable: 'GetObject'
    One or more workflows were affected by this.
    Workflow name: System.Mom.BackwardCompatibility.ServiceStateMonitoring
    Instance name: server.domain.local
    Instance ID: {INSTANCE}
    Management group: GROUP
    Unfortunately the instance in question has since been decommissioned and simply does not exist any more. 
    We're currently on a repeat count of over 350,000 and I would REALLY like to get it stopped. I've had a look at adding an override but that points to the management server rather than the instance itself.
    Does anyone have any suggestions?
    thanks in advance!

    Hi Steven,
    There are for option for us to override a monitor ot rule:
    For all objects of class:             
    Class            
    When you select this option for your override, the override settings apply to all objects in the class at which the rule or monitor is targeted.
    For a group            
    When you select this option for your override, the override settings apply only to members of the group. The rule or monitor without the override settings continues to apply to all objects in the targeted class except for those objects that are also members
    of the group used for the override.
    When you create a group, you save it to an unsealed management pack. However, an element in an unsealed management pack, such as an override, cannot reference an element in a different unsealed management pack, such as a group. If you are going to use a group
    to limit the application of an override, you must either save the group to the same unsealed management pack as the override, or you must seal the management pack that contains the group.
    For a specific object of class:             
    Class            
    When you select this option for your override, the override settings apply only to the specified object. The rule or monitor without the override settings continues to apply to all other objects in the targeted class.
    For all objects of another class            
    When you select this option for your override, the override settings apply only to objects of a class other than the targeted class. The rule or monitor without the override settings continues to apply to all objects in the targeted class.
    Did you try to override it for a specific object of class?
    Regards,
    Yan Li
    Regards, Yan Li

  • How do I schedule an automator script to run at a certain time every day?

    How do I schedule an automator script to run at a certain time every day?
    This used to be done through iCalendar and this option is no longer available.
    How do I do this?
    --Kenoli

    Kenoli Oleari1 wrote:
    How do I schedule an automator script to run at a certain time every day?
    This used to be done through iCalendar and this option is no longer available.
    How do I do this?
    --Kenoli
    You can use lauchd to run the script.
    Here's an example of an Automator App that I have scheduled to run at 7am daily:
    You would save this as com.yourname.plist and put it the the Folder: ~/Library/LaunchAgents/ (then log out and back in, or reboot)
    (To run a workflow, change open to automator)
    (A nice GUI launchd editor is Lingon)
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>com.tonyt.EventReport</string>
              <key>ProgramArguments</key>
              <array>
                        <string>open</string>
                        <string>/Users/Tony/Library/Scripts/Events Report.app</string>
              </array>
              <key>StartCalendarInterval</key>
              <dict>
                        <key>Hour</key>
                        <integer>7</integer>
                        <key>Minute</key>
                        <integer>0</integer>
              </dict>
    </dict>
    </plist>

  • Creation of service for Automated Activity

    Hi All
    I am new to BPM.  I have done some process of human activity with help of some tutorials. It was working fine.
    I am following this [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/501bd56f-a5a6-2b10-4fbf-a61a64055fe4] link.
    I am struck in page No.16.
    I created Web Dyn Pro Component and it is for Human activity.
    Now I would like to create a service for automated activity from the scrach.
    I don't know in which perspective it has to create. But It will be good if it is a CAF Application.
    Can anyone suggest a link for step by step process to create a service for automated activity.
    Regards,
    Nithya
    Edited by: Nithya on Jan 29, 2009 10:20 AM

    Hi Nithya,
                  Yes , u can use Caf Application for Automated Activity .
    Refer this doc for Automate Activity .
    [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-process-management/business-process-modeling/creating%20bpm%20process%20with%20human%20and%20automated%20activities.pdf]
    u can create composite application in composite Application perspective.
    Thanks and regards
    Edited by: Fazal Ahamed on Jan 29, 2009 12:15 PM

  • Bea.jolt.ApplicationException:TPESVCFAIL-application level service failure

    Hi All,
    When I try to open PIA 3 tier I'm getting following error on webpage: "bea.jolt.ApplicationException: TPESVCFAIL - application level service failure".
    Thanks and Regards,
    Vineel.

    This is a very generic error
    See this doc for possible causes and resolutions.
    E-AS: Master Note for "'bea.jolt.ApplicationException: TPESVCFAIL" Error [ID 1201223.1]
    https://support.oracle.com/epmos/faces/DocContentDisplay?id=1201223.1

  • Systemd-tmpfiles-setup.service failure

    Good evening friends.
    I recently made a fresh install of arch linux on my pc and since the first boot up i get this error:
    systemd-tmpfiles-setup.service failure
    Failded to start create volatile files and directories
    When i used "systemctl status" command on it, it said something about unkwnon groups in usr/lib/... somewhere, i can't remember all of it, because after i rebooted and tried the same command, it only said that the process failed, without giving much on details.
    What might be the problem here?
    Last edited by NotaName (2014-09-14 17:42:37)

    falconindy wrote:
    Just a guess, but I think you might have some unknown groups in usr/lib/... somewhere.
    You'll really need to try harder to get the logs. They're still in the journal.
    Thanks for the answer.
    Well, i'm still working on the log finding part, as i'm not sure where they are supposed to be. I checked the /var/log folder files, but it seems that they are not readable/binary maybe?
    P.S. Is this something that i might ignore if i don't find a way to fix it?
    Last edited by NotaName (2014-09-14 19:36:47)

  • External Service Failure: There was no Content-Type header

    We have developed a web service using WLW and deployed it to weblogic 8.1 (install from scratch), we manage to invoke the service successfully. However, when we deploy it to the weblogic 8.1 server installed through PeopleSoft PIA , we keep getting the 'External Service Failure: There was no Content-Type header' error.
    Does anyone know what are the differences for the weblogic installed through PeopleSoft PIA or how we can get around the error? Thanks!

    Hi Jerioon,
    Which Master Page and Content Type did you use when you created a new page layout with Designer Manager?
    Whether you could provide a screenshot about this issue.
    In addition, here is an article about creating a page layout with Designer Manager, please take a look at:
    http://www.learningsharepoint.com/2013/03/03/create-a-custom-page-layout-in-sharepoint-2013/
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Tuxedo calls procedure and Application Level Service Failure

    hello ,professors all!
    My Tuxedo Service just call an procedure exists in oracle9i, i am sure that the procedure runs ok in oracle9i individually, when it was called by my tuxedo service , it is not ok by first time ,and runs out tp application level Service failure error .But strangely it is ok by second time!
    who can explan it to me and show me a way to solve the difficult problem?
    i spend a lot time wondering the answer!
    Edited by: user9086437 on 2010-9-29 下午9:57

    There are many possible reasons why a database procedure might fail the first time it is executed and succeed after that.
    You should check the Tuxedo ULOG and Oracle database logs for any messages that may point to the problem.
    If there is a LIBTUX_CAT:6205 or LIBTUX_CAT:6206 message in the userlog file then you need to add a tx_open() call to your server's tpsvrinit() or tpsvrthrinit() function.
    If there is an OPENINFO string for the group where your server is running then you are using XA transaction management and should not be connecting to the database in your application code; if there is not an OPENINFO string for the group where your server is running then you need to connect to the database in your application.
    If you set the environment variable
    TMTRACE=*:ulog:dye
    for the server where the failure is happening then Tuxedo will write a trace record of each Tuxedo call and each XA call to the ULOG file. This can be helpful in determining why the failure is happening on the first call, especially if Tuxedo is handling transaction management using XA.
    I hope some of this is of help in debugging the problem.
    Ed

Maybe you are looking for

  • LMS 4.1 multiserver config problem

    I m facing a problem in multiserver configuration, in making master-slave servers. Master server config is done, certificates are imported, SSO is also configured and all the pre-requisites given in the multiserver-config doc of lms4.1. While making

  • Getting my mac to recognize Sony Handycam DVD108

    I am having trouble getting my computer to recognize my Sony Handycam. Am I missing a step?

  • Youtube loading is sporadic and inefficient-stop, load, start is it mozilla or my computer?

    not just youtube - i cannot load online video well - so the question is - is it my computer or is it mozilla?

  • ICal and anniversaries

    While I can link iCal to Address Book for a Birthdays calendar, there seems no way to do the same for Anniversaries, Death Date, etc. Is this possible and, if so, how?

  • IPod wont boot

    Well, whenever I try to turn on my iPod it goes to the white screen saying Connect to your computer. Use iTunes to restore. So I connect it to my computer but my computer and iTunes don't recognize it except in Safely Remove Hardware. So I've put it