Script for checking datasource connections

Hi,
I would like to find out if it's possible to monitor datasource connections using Unix based scripts and if so how can this be accomplished?
Thank you in advance
Twaggz

Hi
Thanks for the link however I was looking at enabling monitoring at an AIX level.

Similar Messages

  • Power Shell Script for Check Remote machinces are live or not

    I have required a Power Shell Script for Check multiple Remote machines are live or not.Please guide me

    This will do it.
    http://gallery.technet.microsoft.com/Ping-IP-Adress-Range-d90ce82d
    ¯\_(ツ)_/¯

  • Unix script for checking the user account status

    Hi All,
    i have created one unix script to check the status of the user in diff databases.
    #!/bin/ksh
    useracctreport.txt if [ ! -f hh ];
    then
    echo "Database file does not exist"
    fi
    echo "Enter Username"
    read USER
    echo "Enter the password"
    stty -echo
    read PASS
    stty echo
    for j in `cat users`
    do
    j="`echo $j| tr '[a-z]' '[A-Z]'`"
    for i in `cat hh`
    do
    sqlplus -s $USER/$PASS\@$i <<EOF >> useracctreport.txt
    column USERNAME format a8
    column ACCOUNT_STATUS format a5
    !echo "*****User $j Status in $i DB*****"
    select USERNAME,ACCOUNT_STATUS from dba_users where username=('$j');
    select OBJECT_TYPE,count(*) from dba_objects where owner='$j' group by object_type;
    EOF
    done
    done
    In log file ,i get the below error when its unable to connect to the DB.
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    ERROR:
    ORA-01017: invalid username/password; logon denied
    Is there any way i can supress this error?
    and is there any other way i can make this script faster.Thanks a lot for your help

    Hi,
    The failing line is
    sqlplus -s $USER/$PASS\@$i <<EOF >> useracctreport.txtYou should test the connect statement you provide to sqlplus. For example:
    CONSTRING=$USER/$PASS\@$i
    echo Connect string used: $CONSTRING
    sqlplus -s $CONSTRING <<EOF >> useracctreport.txtCheck the echoed value. It's malformed. Correct it appropriately.
    Yoann.

  • Script to check RDP connection status

    Hi all,
    Could anyone provide me a script to check whether multiple remote servers are able to RDP or not. I just want to check the connectivity status. I have checked with past threads available in form, but none has worked for me. Powershell or Batch or VBS scripts
    ... anything would be good....
    I am not that much good at writing scripts.. So please help me.
    Thanks in Advance..
    Vinay..

    Run this script on one of the servers:
    Get-Wmiobject -Class Win32_Terminal -Property *
    It should return a number of information including, fEnableTerminal. For servers that have RDP enabled, fEnableTerminal should be 1, for the servers with RDP not enabled, fEnableTerminal should be 0.
    Once you can confirm that this is the case, I will provide the full script to run this on multiple servers with input from AD query of text file
    That still won't tell you if the TS is accessible.  PortQry or Net Tcp are the fastest and easiest ways to do this.
    Your code also only orks on WS2008R2 and later but, s posted, ill not work on any system.  Have you actually tried it?
    The other bigger issue is that the Win32_Terminal class will always return enabled on any server even if the terminal server is inaccessible and even if it is in Admin mode.  All Servers since 2003 have Terminal Server running by default but not in
    Terminal Server mode.
    PortQry to 3389 will tell us that the TS is alive and available.  Win32_Terminal will report enabled even if the service is stopped.
    Win32_Terminal is only useful to admins and PortQry can be used by anyone.
    The above PowerShell code can be run on any system instead of installing PortQry or other software.
    The original question was "Check RDP connection".  RDP is available on all systems since XP.  The Win32_Terminal class is only available on Server class machines and it does not check to see if the RDP connection is available.
    ¯\_(ツ)_/¯

  • Script for 'Check Links Before Opening Document' preference

    I'm trying to find the VB script for changing the "Check Links Before Opening Document" checkbox on the File Handling panel in the Preferences dialog? I haven't found any documentation referring to the Links items on that panel.
    Bob

    Thanks for the info.
    Was there a document you pulled this from?
    I have an old document from CS2 days that is invaluable for providing a detailed list of available script methods and properties. Obviously things that have been added in subsequent InDesign releases aren't in this document. Later InDesign CS releases offer script SDKs that contain helpful sample scripts but I don't find a detailed summary similar to one from CS2. Have I just not found them? Or how does one find the script method/property for things not contained in the sample scripts?

  • Executing a powershell script for checking duplicate users while creating a AD user throug ADUC console.

    Hi,
    I have a text file in which some SamAccountNames are present.I need to check the file while creating a new users through ADUC console.If a username that is going to create through ADUC console is present in the file, then it should prompt a message
    that the user is already present in the text file.
    Is there any possibility of contacting the powershell script from the ADUC console.If so, then while creating a new user through ADUC console, what is the proceedure for executing that powershell script.
    please provide me the approriate solutions.
    Thanks
    Prasanthi k

    Run the below Powershell Script for users are exist or not in AD. Later you can create the users.
    #Find Users exist in AD or Not?
    #Biswajit Biswas
    $users = get-content c:\users.txt
    foreach ($user in $users) {
    $User = Get-ADUser -Filter {(samaccountname -eq $user)}
    If ($user -eq $Null) {"User does not exist in AD ($user)" }
    Else {"User found in AD ($user)"}
    Active Directory Users attributes-Powershell
    http://gallery.technet.microsoft.com/scriptcenter/Getting-Users-ALL-7417b71d
    Regards~Biswajit
    Disclaimer: This posting is provided & with no warranties or guarantees and confers no rights.
    MCP 2003,MCSA 2003, MCSA:M 2003, CCNA, MCTS, Enterprise Admin
    MY BLOG
    Domain Controllers inventory-Quest Powershell
    Generate Report for Bulk Servers-LastBootUpTime,SerialNumber,InstallDate
    Generate a Report for installed Hotfix for Bulk Servers

  • ECMA script for checking active workflows for an list item

    Hi i am having more than 1 workflow associated with the list if there is any workflow that is active for an item then i need to prevent starting another workflow for the same item. I am using the following code to achieve the same. Can anyone please provide
    me the ECMA object model equivalent for achieving the same.
        //Check for any active workflows for the document
            private void CheckForActiveWorkflows()
                // Parameters 'List' and 'ID' will be null for site workflows.
                if (!String.IsNullOrEmpty(Request.Params["List"]) && !String.IsNullOrEmpty(Request.Params["ID"]))
                    this.workflowList = this.Web.Lists[new Guid(Request.Params["List"])];
                    this.workflowListItem = this.workflowList.GetItemById(Convert.ToInt32(Request.Params["ID"]));
                SPWorkflowManager manager = this.Site.WorkflowManager;
                SPWorkflowCollection workflowCollection = manager.GetItemActiveWorkflows(this.workflowListItem);
                if (workflowCollection.Count > 0)
                    SPUtility.TransferToErrorPage("An workflow is already running for the document. Kindly complete it before starting a new workflow");
            }

    Hi,
    According to your post, my understanding is that you wanted to use ECMA script to check active workflows for an list item.
    You can use the Workflow web service "/_vti_bin/workflow.asmx"
    - GetWorkflowDataForItem operation in particular.
    Here is a great blog for you to take a look at:
    http://jamestsai.net/Blog/post/Using-JavaScript-to-check-SharePoint-list-item-workflow-status-via-Web-Service.aspx
    In addition, you can use
    SPServices. For more information, please refer to:
    http://sharepoint.stackexchange.com/questions/72962/is-there-a-way-to-check-if-a-workflow-is-completed-using-javascript
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Bash script for checking link status

    So I'm doing some SEO work I've been tasked with checking a couple hundred thousand back links for quality.  I found myself spending a lot of time navigating to sites that no longer existed.  I figured I would make a bash script that checks if the links are active first.  The problem is my script is slower than evolution.  I'm no bash guru or anything so I figured maybe I would see if there are some optimizations you folks can think of.  Here is what I am working with:
    #!/bin/bash
    while read line
    do
    #pull page source and grep for domain
    curl -s "$line" | grep "example.com"
    if [[ $? -eq 0 ]]
    then
    echo \"$line\",\"link active\" >> csv.csv else
    echo \"$line\",\"REMOVED\" >> csv.csv
    fi
    done < <(cat links.txt)
    Can you guys think of another way of doing this that might be quicker?  I realize the bottleneck is curl (as well as the speed of the remote server/dns servers) and that there isn't really a way around that.  Is there another tool or technique I could use within my script to speed up this process?
    I will still have to go through the active links one by one and analyze by hand but I don't think there is a good way of doing this programmatically that wouldn't consume more time than doing it by hand (if it's even possible).
    Thanks

    I know it's been awhile but I've found myself in need of this yet again.  I've modified Xyne's script a little to work a little more consistently with my data.  The problem I'm running into now is that urllib doesn't accept IRIs.  No surprise there I suppose as it's urllib and not irilib.  Does anyone know of any libraries that will convert an IRI to a URI?  Here is the code I am working with:
    #!/usr/bin/env python3
    from threading import Thread
    from queue import Queue
    from urllib.request import Request, urlopen
    from urllib.error import URLError
    import csv
    import sys
    import argparse
    parser = argparse.ArgumentParser(description='Check list of URLs for existence of link in html')
    parser.add_argument('-d','--domain', help='The domain you would like to search for a link to', required=True)
    parser.add_argument('-i','--input', help='Text file with list of URLs to check', required=True)
    parser.add_argument('-o','--output', help='Named of csv to output results to', required=True)
    parser.add_argument('-v','--verbose', help='Display URLs and statuses in the terminal', required=False, action='store_true')
    ARGS = vars(parser.parse_args())
    INFILE = ARGS['input']
    OUTFILE = ARGS['output']
    DOMAIN = ARGS['domain']
    REMOVED = 'REMOVED'
    EXISTS = 'EXISTS'
    NUMBER_OF_WORKERS = 50
    #Workers
    def worker(input_queue, output_queue):
    while True:
    url = input_queue.get()
    if url is None:
    input_queue.task_done()
    input_queue.put(None)
    break
    request = Request(url)
    try:
    response = urlopen(request)
    html = str(response.read())
    if DOMAIN in html:
    status = EXISTS
    else:
    status = REMOVED
    except URLError:
    status = REMOVED
    output_queue.put((url, status))
    input_queue.task_done()
    #Queues
    input_queue = Queue()
    output_queue = Queue()
    #Create threads
    for i in range(NUMBER_OF_WORKERS):
    t = Thread(target=worker, args=(input_queue, output_queue))
    t.daemon = True
    t.start()
    #Populate input queue
    number_of_urls = 0
    with open(INFILE, 'r') as f:
    for line in f:
    input_queue.put(line.strip())
    number_of_urls += 1
    input_queue.put(None)
    #Write URL and Status to csv file
    with open(OUTFILE, 'a') as f:
    c = csv.writer(f, delimiter=',', quotechar='"')
    for i in range(number_of_urls):
    url, status = output_queue.get()
    if ARGS['verbose']:
    print('{}\n {}'.format(url, status))
    c.writerow((url, status))
    output_queue.task_done()
    input_queue.get()
    input_queue.task_done()
    input_queue.join()
    output_queue.join()
    The problem seems to be when I use urlopen
    response = urlopen(request)
    with a URL like http://www.rafo.co.il/בר-פאלי-p1
    urlopen fails with an error like this:
    Exception in thread Thread-19:
    Traceback (most recent call last):
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/threading.py", line 639, in _bootstrap_inner
    self.run()
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/threading.py", line 596, in run
    self._target(*self._args, **self._kwargs)
    File "./linkcheck.py", line 35, in worker
    response = urlopen(request)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 160, in urlopen
    return opener.open(url, data, timeout)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 473, in open
    response = self._open(req, data)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 491, in _open
    '_open', req)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 451, in _call_chain
    result = func(*args)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 1272, in http_open
    return self.do_open(http.client.HTTPConnection, req)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 1252, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/client.py", line 1049, in request
    self._send_request(method, url, body, headers)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/client.py", line 1077, in _send_request
    self.putrequest(method, url, **skips)
    File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/http/client.py", line 941, in putrequest
    self._output(request.encode('ascii'))
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-8: ordinal not in range(128)
    I'm not too familiar with how character encoding works so I'm not sure where to start.  What would be a quick and dirty way (if one exists) to get URLs like this to play nicely with python's urlopen?

  • CSS Script for checking RADIUS Service

    Hi,
    We are using CSS 11501 boxes for load-sharing RADIUS (NAC) requests between different ACS Servers.
    How can I configure a keepalive method for checking the RADIUS service on the ACS Servers ?
    If this needs to be a script then Can anyone provide some hints\tips ?
    Thanks,
    Naman

    This needs to be a script.
    The best way would be to sniff a request/response from a known user [or fake user], then extract the udp header + payload in hex format, then create a CSS script to send the hex formatted query and to verify that the hex formatted response matches the server response.
    I believe the ap-kal-dns script uses a similar approach so you can look at it to get an idea of what you have to do.
    Gilles.

  • Script for checking hardware failures on Solaris

    Hi all,
    I am trying to write a script that checks failures/faults on the Solaris servers(8/9/10) using commands prtdiag -v, echo | format,metastat errors and iostat errors .
    Does anyone have scripts like that?
    Cheers

    please share the script...It doesn't work that way.
    These are technical forums, not replacements for you doing your own work.
    People will be happy to respond with suggestions when you show what you have done but you need to display that you have done some effort first. You have not pasted any of your script here so no one can suggest any improvements to your work.
    Go read the first two replies. They give you a lot of possibilities.

  • Script for checking the replication process in Netscape Directory Sever 4.1

    Hi,
    We are using Netscape Directory Server 4.1.6 in our production environment. Where we want to know is there any script available to check the replication process. Or can we write a script to check the process.
    Waiting for your replies at the earliest.
    Thanks,
    Syed A.

    Hi Syed,
    Replication state is very easy to see in 4.x and earlier. The last changenumber in the supplier changelog is visible (on the root DSE IIRC), and each consumer suffix has an operational attribute "copiedfrom" that tells you the name of the supplier, the database generation id, and the last change replayed from the supplier.
    So a script that compares the results of
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" lastchangenumber
    and
    ldapsearch -h <consumer> -s base -b <base_suffix> "objectclass=*" copiedFrom
    will show you if a replica has fallen out of sync. It won't tell you more than how many changes behind the replica is, though, because pre-5.x changenumbers are sequential integers, not timestamps.
    However, the change that corresponds to the changenumber is clearly visible under the "cn=changelog" suffix. So if you look at the change itself you can see the timestamp on it.
    For more info on the status of replication, you should be able to query the agreements on the supplier. Those live under the "Netscape Machine Data Suffix", which you can also find on the supplier's root DSE:
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" netscapemdsuffix
    And of course the error logs will usually tell you if replication is failing outright.
    I may be off on some of the attribute names, but if you do some investigating along these lines, you should be able to figure it out.

  • Script for Checking the Server Status

    Hi All,
         I just need the script for monitoring the server status through the WLST.My scenario:I have 2 server in Running State.If any one of the server get failed or in not RUNNING state then i use the script for starting that server automatically.I tried some of the script but it is not working properly .If any one have the sample script please share with me.
    Regards,
    Ove.

    Hi Syed,
    Replication state is very easy to see in 4.x and earlier. The last changenumber in the supplier changelog is visible (on the root DSE IIRC), and each consumer suffix has an operational attribute "copiedfrom" that tells you the name of the supplier, the database generation id, and the last change replayed from the supplier.
    So a script that compares the results of
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" lastchangenumber
    and
    ldapsearch -h <consumer> -s base -b <base_suffix> "objectclass=*" copiedFrom
    will show you if a replica has fallen out of sync. It won't tell you more than how many changes behind the replica is, though, because pre-5.x changenumbers are sequential integers, not timestamps.
    However, the change that corresponds to the changenumber is clearly visible under the "cn=changelog" suffix. So if you look at the change itself you can see the timestamp on it.
    For more info on the status of replication, you should be able to query the agreements on the supplier. Those live under the "Netscape Machine Data Suffix", which you can also find on the supplier's root DSE:
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" netscapemdsuffix
    And of course the error logs will usually tell you if replication is failing outright.
    I may be off on some of the attribute names, but if you do some investigating along these lines, you should be able to figure it out.

  • Problem in Sap script for Check printing

    Hi all,
      I have problem in Check printing for FI Module. In Tcode f-58 i am taking the printout of checks. For my user they want to move the main window in upwards, but the sap script <b>F110_PRENUM_CHCK</b> not allowing to move upwards. how to do this, its urgent. plz
    point wil be sure.
    Gowri

    Hi
    Copy the script F110_prenum_chek to some ZCHECK and do the changes.
    Why you can't change the MAIN window towards up?
    You can changes ths ize of it by adjusting the setting of it .
    generally we use some pre printed stationary for this in which all the line item data with doc numbers is printed on top and the check will be in bottom
    and in check we just print the few fields in the right positions.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Script for check table exeststance

    Hi,
    We have 20 instances
    I want to create a shell script like
    1. it will check existence of the table in dba schema
    2. then will check existence of data in the table
    Also send the mail to distro if table is not exits

    I have created one script
    Is it ok ?
    #!/bin/ksh
    for conn in `cat conn_mkt.lst`
    do
    mkt=`echo $conn |cut -d "/" -f1 | cut -b 1-3`
    inst=`echo $conn |cut -d "@" -f2|cut -d "|" -f1`
    owner=`echo $conn |cut -d "/" -f1`
    rm -rf Log/check_table_${mkt}.log
    rm -rf Log/check_count_${mkt}.log
    sqlplus -s ****/****@${inst} <<EOF
    set feed off verify on pages 200 echo on serveroutput on
    spool Log/check_table_${mkt}.log
    select table_name from dba_tables where owner='DBA' and table_name='USR_CONTROL_LOGIN';
    spool off;
    exit
    EOF
    if [ -s Log/check_table_${mkt}.log ]; then
    sqlplus -s ****/****@${inst} <<EOF
    set feed off verify on pages 200 echo on serveroutput on
    spool Log/check_count_${mkt}.log
    select count(1) from TLG_DBA.USR_CONTROL_LOGIN;
    spool off;
    exit;
    EOF
    mailx -s " Table USR_CONTROL_LOGIN is exists in $mkt `cat Log/check_count_${mkt}.log`" <email>
    else
    mailx -s I " Table USR_CONTROL_LOGIN is not exists in $mkt " <email>
    done

  • Script for checking a box in safari menu?

    how does one do this? What I'm looking for is a script that will open Safari and check the "Disable WebCore Caches" box on the "Show Caches Window" submenu in the "Debug" menu, and I'm totally out of my league...thanks
    InteliMac   Mac OS X (10.4.8)  

    Hi Dread
    Had a lot of trouble figuring out where the "Debug" menu was for a start, only
    to find it is a hidden menu within Safari, and to unlock it you need to do as the script says below.
    Type the following into terminal, with Safari closed, then activate Safari
    and theirs the "Debug" menu.
    % defaults write com.apple.Safari IncludeDebugMenu 1
    type the below with Safari closed to deactivate the "Debug" menu.
    % defaults write com.apple.Safari IncludeDebugMenu 0
    ok, got this far, just having a wee issue in getting the check box to change it's value to 1,
    tell application "Safari"
    activate
    end tell
    tell application "System Events"
    tell process "Safari"
    tell menu bar 1
    tell menu bar item "Debug"
    tell menu "Debug"
    click menu item "Show Caches Window"
    --click checkbox "Disable WebCore Caches" of menu item "Show Caches Window" of menu 1 of menu bar item "Debug" of menu bar 1
    --or
    set value of checkbox "Disable WebCore Caches" to 1
    end tell
    end tell
    end tell
    end tell
    end tell
    Budgie

Maybe you are looking for

  • LifeCycle PDF form = small size, Acrobat PDF extended to READER = LARGE SIZE

    When creating the dynamic PDF form in LiveCycle Designer ES 8.2.x, the file size is < 200K. When opening in Acrobat 9 Pro and extending to Acrobat Reader, the file size > 1.2MB. Is there any way to reduce the file size? Thanks! -JoeF

  • Hw to get statistics of procedure in oracle

    hi i m executing procedure which calls many subprocesses and all running successfully now i would like to know how can get all statistics that time taken by procedures and other details. is there any dbms utility to generate such script i know TKPROF

  • Output Condition Records based on Document Value

    I have a need to send/not send different pieces of output based off of Quote value. Example:  if a quotation is over $100 send a copy of the quotation to the field sales rep automatically.  And simultaneously if the quotation is under $4000 automatic

  • Mulitible check boxes but only select one in each row who I do it with Acrobat Pro X?

    Dear Forum Readers First, if I should post my entry in the wrong forum, forgive me but I didn't found the right place! I start to learn about the Adobe Pro X to create a form with different checkboxes, everything goes very well but now I decide it wo

  • Any other ways to turn orientation lock on/off?

    The whole right side of my screen does not work, I need to turn the portrait orientation lock off so I can text using landscape mode. But because I cannot use the right side of my screen I cannot simply turn it off using the control center. Are there