Nginx client_ip in log file, with ssh -R Port forwarding

Hi, everyone!
First, I run a nginx server M1 (in my offce)  behind a router R1 and M1's IP addr is 192.168.5.126. I set nginx's log format like this:
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
After that, I will get the correct client ip in the access log.
192.168.5.88 - - [21/Apr/2015:11:12:47 +0800] "GET /js/date.js HTTP/1.1" 200 403 "http://192.168.5.126/" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36" "-"
Then, I want to visit M1 outside (in the campus) .  Unfortunately, I can do nothing with the router R1. But I have a router R2 whose framework is OpenWrt and its IP 222.xx.xx.xx can be visited by anyone who has logged into the campus network.
Then I wrote a autossh service to do that:
[Unit]
Description=AutoSSH service for local port 80 forwarded to 222.xx.xx.xx:80
# place this in /etc/systemd/system/, than enable this.
After=network.target
Requires=nginx.service
After=nginx.service
[Service]
Environment="AUTOSSH_GATETIME=0" "AUTOSSH_POLL=60" "AUTOSSH_LOGFILE=/var/log/nginxssh.log"
ExecStart=/usr/bin/autossh -M 22000 -NR 222.xx.xx.xx:808:localhost:808 -NR 222.xx.xx.xx:80:localhost:80 -o TCPKeepAlive=yes -p xxxx [email protected] -i /home/username/.ssh/id_rsa
[Install]
WantedBy=multi-user.target
Yeah, It works! BUT BUT when someone visits 222.xx.xx.xx, I lost the  the client ip in nginx log file. That would always be 127.0.0.1, why?
127.0.0.1 - - [27/Apr/2015:00:34:07 +0800] "GET /static/mathjax/MathJax.js?config=TeX-AMS_HTML HTTP/1.1" 304 0 "http://222.xx.xx.xx:808/url/jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:37.0) Gecko/20100101 Firefox/37.0" "-"
After ``ssh -R Port forwarding``,  client ip is lost?
If so,  what should I use to replace ``ssh -R``?
Last edited by limser (2015-05-04 12:39:18)

It seems there is a port forwarding configuration trouble with you modem.
When you access from the WAN or from the LAN, you don't enter in you modem the same way, so the behavior is different.
It seems that the port 22 of your modem is not directly forwarded to your server. The modem itself asks you a login/password. The key-pair authentification is between laptop and server. The modem itself is not recognized during this authentification.
Don't touch your ssh-config. It's OK since it was working for monthes before you change your modem.

Similar Messages

  • Can't create log file with java.util.logging

    Hi,
    I have created a class to create a log file with java.util.logging
    This class works correctly as standalone (without jdev/weblogic)
    import java.io.IOException;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.logging.*;
    public class LogDemo
         private static final Logger logger = Logger.getLogger( "Logging" );
         public static void main( String[] args ) throws IOException
             Date date = new Date();
             DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
             String dateStr = dateFormat.format(date);
             String logFileName = dateStr + "SEC" + ".log";
             Handler fh;          
             try
               fh = new FileHandler(logFileName);
               //fh.setFormatter(new XMLFormatter());
               fh.setFormatter(new SimpleFormatter());
               logger.addHandler(fh);
               logger.setLevel(Level.ALL);
               logger.log(Level.INFO, "Initialization log");
               // force a bug
               ((Object)null).toString();
             catch (IOException e)
                  logger.log( Level.WARNING, e.getMessage(), e );
             catch (Exception e)
                  logger.log( Level.WARNING, "Exception", e);
    }But when I use this class...
    import java.io.File;
    import java.io.IOException;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.logging.FileHandler;
    import java.util.logging.Handler;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import java.util.logging.XMLFormatter;
    public class TraceUtils
      public static Logger logger = Logger.getLogger("log");
      public static void initLogger(String ApplicationName) {
        Date date = new Date();
        DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
        String dateStr = dateFormat.format(date);
        String logFileName = dateStr + ApplicationName + ".log";
        Handler fh;
        try
          fh = new FileHandler(logFileName);
          fh.setFormatter(new XMLFormatter());
          logger.addHandler(fh);
          logger.setLevel(Level.ALL);
          logger.log(Level.INFO, "Initialization log");
        catch (IOException e)
          System.out.println(e.getMessage());
    }and I call it in a backingBean, I have the message in console but the log file is not created.
    TraceUtils.initLogger("SEC");why?
    Thanks for your help.

    I have uncommented this line in logging.properties and it works.
    # To also add the FileHandler, use the following line instead.
    handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandlerBut I have another problem:
    jdev ignore the parameters of the FileHandler method .
    And it creates a general log file with anothers log files created each time I call the method logp.
    So I play with these parameters
    fh = new FileHandler(logFileName,true);
    fh = new FileHandler(logFileName,0,1,true);
    fh = new FileHandler(logFileName,10000000,1,true);without succes.
    I want only one log file, how to do that?

  • Do we need to format data and log files with 64k cluster size for sql server 2012?

    Do we need to format data and log files with 64k cluster size for sql server 2012?
    Does this best practice still applies to sql server 2012 & 2014?

    Yes.  The extent size of SQL Server data files, and the max log block size have not changed with the new versions, so the guidance should remain the same.
    Microsoft SQL Server Storage Engine PM

  • Getting empty log files with log4j and WebLogic 10.0

    Hi!
    I get empty log files with log4j 1.2.13 and WebLogic 10.0. If I don't run the application in the application server, then the logging works fine.
    The properties file is located in a jar in the LIB folder of the deployed project. If I change the name of the log file name in the properties file, it just creates a new empty file.
    What could be wrong?
    Thanks!

    I assume that when you change the name of the expected log file in the properties file, the new empty file is that name, correct?
    That means you're at least getting that properties file loaded by log4j, which is a good sign.
    As the file ends up empty, it appears that no logger statements are being executed at a debug level high enough for the current debug level. Can you throw in a logger.error() call at a point you're certain is executed?

  • OMBPlus: masking usernames / passwords in log files with ********?

    Hi all,
    Subjects says it: how to hide username and password in OMBPlus logs.
    Any ideas...?
    Br: Ykspisto

    I don't use default OMB+ logging for this reason, plus I often want more robust logging. I also built a wrapper for executing OMB+ statements to simplify my exception handling in my main scripts. By catching both the return string from a statement as well as the exception strings, I keep full control over what gets logged.
    HEre is the meat of my main library file:
    # PVCS Version Information
    #/* $Workfile:   omb_library.tcl  $ $Revision:   2.9  $ */
    #/* $Author:   michael.broughton  $
    #/* $Date:   10 Mar 2009 11:04:50  $ */
    # Default logging function.
    #  Accepts inputs: LOGMSG - a text string to output
    proc log_msg {LOGTYPE LOGMSG} {
       #logs to screen and file
       global SPOOLFILE
       if {![info exists SPOOLFILE]} {
           puts "LOGFILE UNDEFINED! :-> $LOGTYPE:-> $LOGMSG"
       } else {
           set fout [open "$SPOOLFILE" a+]     
           puts $fout "$LOGTYPE:-> $LOGMSG"
           puts "$LOGTYPE:-> $LOGMSG"
           close $fout
    proc log_msg_file_only {LOGTYPE LOGMSG} {
        #logs to file only
        global SPOOLFILE
        if {![info exists SPOOLFILE]} {
           puts "LOGFILE UNDEFINED! :-> $LOGTYPE:-> $LOGMSG"
        } else {
           set fout [open "$SPOOLFILE" a+]     
           puts $fout "$LOGTYPE:-> $LOGMSG"
           close $fout
    proc exit_failure { msg } {
       log_msg ERROR "$msg"
       log_msg ERROR "Rolling Back....."
       exec_omb OMBROLLBACK
       log_msg ERROR "Exiting....."
       # return and also bail from calling function
       return -code 2
    proc exec_omb { args } {
       # Uncomment if you want all source commands spooled out to log
       # disabled in production to avoid logging passwords.
       # log_msg_file_only OMBCMD "$args"
       # the point of this is simply to return errorMsg or return string, whichever is applicable,
       # to simplify error checking using omb_error{}
       if [catch { set retstr [eval $args] } errmsg] {
          log_msg OMB_ERROR "$errmsg"
          log_msg "" ""
          return $errmsg
       } else {
          log_msg OMB_SUCCESS "$retstr"
          log_msg "" ""
          return $retstr
    proc omb_error { retstr } {
       # OMB and Oracle errors may have caused a failure.
       if [string match OMB0* $retstr] {
          return 1
       } elseif [string match ORA-* $retstr] {
          return 1
       } elseif [string match java.* $retstr] {
          return 1
       } elseif [string match Error* $retstr] {
          return 1
       } else {
          return 0
    proc ers_omb_connect { OWB_USER OWB_PASS OWB_HOST OWB_PORT OWB_SRVC OWB_REPOS } {
       # Commit anything from previous work, otherwise OMBDISCONNECT will fail out.
       catch { set retstr [ OMBSAVE ] } errmsg
       log_msg LOG "Checking current connection status...."
       #Ensure that we are not already connected.
       if [catch { set discstr [ OMBDISCONNECT ] } errmsg ] {
          set discstr $errmsg
       # Test if message is "OMB01001: Not connected to repository." or "Disconnected."
       # any other message is a showstopper!
       if [string match Disconn* $discstr ]  {
          log_msg LOG "Success Disconnecting from previous repository...."
       } else {
          # We expect an OMB01001 error for trying to disconnect when not connected
          if [string match OMB01001* $discstr ] {
              log_msg LOG "Disconnect unneccessary. Not currently connected...."
          } else {
              log_msg ERROR "Error Disconnecting from previous repository....Exiting process."
              exit_failure "$discstr"
       set print [exec_omb OMBCONNECT $OWB_USER/$OWB_PASS@$OWB_HOST:$OWB_PORT:$OWB_SRVC USE REPOSITORY '$OWB_REPOS']
       if [string match *Connected* $print] {
          return $print
       } else {
          return "OMB0-Unknown Error connecting. Validate connection settings and try again"
    }and I handle setting up the log file with a standard header at the top of each script, as illustrated here in a script I use to set up and register a location and control centers for when we build a new dev environment. Most of the referenced variables are held in a config script that we use to define our current working environment, which I am not attaching as the names are pretty descriptive I think.
    # PVCS Version Information
    #/* $Workfile:   setup_dev_location.tcl  $ $Revision:   2.1  $ */
    #/* $Author:   michael.broughton  $
    #/* $Date:   27 Nov 2008 10:00:00  $ */
    #  Get Current Directory and time
    # supporting config and library files must be in the same directory as this script
    set dtstmp     [ clock format [clock seconds] -format {%Y%m%d_%H%M}]
    set scrpt      [ file split [file root [info script]]]
    set scriptDir  [ file dirname [info script]]
    set scriptName [ lindex $scrpt [expr [llength $scrpt]-1]]
    set cnfg_lib "$scriptDir/ombplus_config.tcl"
    set owb_lib  "$scriptDir/omb_library.tcl"
    set sql_lib  "$scriptDir/omb_sql_library.tcl"
    #  Import Lbraries
    #get config file
    source $cnfg_lib
    #get standard library
    source $owb_lib
    #get SQL library
    source $sql_lib
    #  Set Logfile
    #    This will overwrite anything set in the config file.
    set LOG_PATH "$scriptDir/logs"
    file mkdir $LOG_PATH
    set    SPOOLFILE  ""
    append SPOOLFILE $LOG_PATH "/log_"  $scriptName "_" $dtstmp ".txt"
    #  Connect to repos
    set print [ers_omb_connect $OWB_DEG_USER $OWB_DEG_PASS $OWB_DEG_HOST $OWB_DEG_PORT $OWB_DEG_SRVC $OWB_DEG_REPOS]
    if [omb_error $print] {
        log_msg ERROR "Unable to connect to repository."
        log_msg ERROR "$print"
        log_msg ERROR "Exiting Script.............."
        return
    } else {
        log_msg LOG "Connected to Repository"   
    # Connect to project
    set print [exec_omb OMBCC '$PROJECT_NAME']
    if [omb_error $print] {
       exit_Failure "Project $PROJECT_NAME does not exist. Exiting...."
    } else {
       log_msg LOG "Switched context to project $PROJECT_NAME"
    # Check Existance of Oracle Module
    set print [exec_omb OMBCC '$ORA_MODULE_NAME']
    if [omb_error $print] {
       exit_Failure "Module $ORA_MODULE_NAME does not exist. Creating...."
    } else {
       log_msg LOG "Confirmed existance of module $ORA_MODULE_NAME"
    #switch back up to project level. You cannot attach locations to a module if you are in it.
    exec_omb OMBCC '..'
    log_msg LOG "Switched context back up to project $PROJECT_NAME"
    # Force Re-registration of OWB User
    log_msg LOG "(Re-)Registering user $DATA_LOCATION_USER"
    log_msg LOG "Disconnecting from Corporate Design Repository"
    exec_omb OMBCOMMIT
    exec_omb OMBDISCONNECT
    log_msg LOG "Connecting to Runtime Repository"
    set print [ers_omb_connect $CONTROL_CENTER_SCHEMA $CONTROL_CENTER_PASS $DATA_LOCATION_HOST $DATA_LOCATION_PORT $DATA_LOCATION_SRVC $CONTROL_CENTER_SCHEMA]
    set print [ exec_omb OMBUNREGISTER USER '$DATA_LOCATION_USER' IDENTIFIED BY '$DATA_LOCATION_PASS' ]
    set print [ exec_omb OMBREGISTER USER '$DATA_LOCATION_USER' SET PROPERTIES (DESCRIPTION, ISTARGETSCHEMA, TARGETSCHEMAPWD) VALUES ('$DATA_LOCATION_USER', 'true', '$DATA_LOCATION_PASS')]
    if [omb_error $print] {
       exit_failure "Unable to register user '$DATA_LOCATION_USER'"
    log_msg LOG "Disconnecting from Runtime Repository"
    exec_omb OMBCOMMIT
    exec_omb OMBDISCONNECT
    log_msg LOG "Re-Connecting to Corporate Design Repository"
    set print [ers_omb_connect $OWB_DEG_USER $OWB_DEG_PASS $OWB_DEG_HOST $OWB_DEG_PORT $OWB_DEG_SRVC $OWB_DEG_REPOS]
    log_msg LOG "Changing context back to project $PROJECT_NAME"
    set print [exec_omb OMBCC '$PROJECT_NAME']
    # Validate to Control Center
    set lst [OMBLIST CONTROL_CENTERS]
    if [string match *$CONTROL_CENTER_NAME* $lst] {
       log_msg LOG "Verified Control Center $CONTROL_CENTER_NAME Exists."
       set lst [OMBLIST LOCATIONS]
       if [string match *$DATA_LOCATION_NAME* $lst] {
           log_msg LOG "Verified Location $DATA_LOCATION_NAME Exists."
           log_msg LOG "Setting Control Center as default control center for project"
           exec_omb OMBCC 'DEFAULT_CONFIGURATION'
           set print [exec_omb OMBALTER DEPLOYMENT 'DEFAULT_DEPLOYMENT' SET REF CONTROL_CENTER '$CONTROL_CENTER_NAME' ]
           if [omb_error $print] {
              exit_failure "Unable to set Control Center $CONTROL_CENTER_NAME in default configuration"
           exec_omb OMBCOMMIT
           exec_omb OMBCC '..'
           log_msg LOG "Setting Passwords to enable import and deploy"
           set print [exec_omb OMBALTER LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (PASSWORD) VALUES ('$DATA_LOCATION_PASS')]
           if [omb_error $print] {
              exit_failure "Unable to log onto location '$DATA_LOCATION_NAME' with password $DATA_LOCATION_PASS"
           exec_omb OMBCOMMIT
           log_msg LOG "Connecting to Control Center $CONTROL_CENTER_NAME"
           set print [exec_omb OMBCONNECT CONTROL_CENTER USE '$DATA_LOCATION_PASS' ]
           if [omb_error $print] {
              exit_failure "Unable to connect to Control Center $CONTROL_CENTER_NAME"
           exec_omb OMBCOMMIT
           log_msg LOG "Connected.............."
       } else {
           log_msg LOG "Control Center Exists, but Location Does Not."
           log_msg LOG "Creating Code Location."
           log_msg LOG "Checking Global_names...."
           set dbGlobalNames FALSE
           set oraConn [oracleConnect $OWB_DEG_HOST $OWB_DEG_SRVC $OWB_DEG_PORT $OWB_DEG_USER $OWB_DEG_PASS ]
           set oraRs [oracleQuery $oraConn "select value pvalue FROM V\$PARAMETER where name = 'global_names'"]
           while {[$oraRs next]} {
               set dbGlobalNames [$oraRs getString pvalue]
           $oraRs close
           $oraConn close
           log_msg LOG "Global_names are $dbGlobalNames...."
           if [string match TRUE $dbGlobalNames] {
               set print [exec_omb OMBCREATE LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE, CONNECT_AS_USER, PASSWORD, DATABASE_NAME) VALUES ('ORACLE_DATABASE','$DATA_LOCATION_VERS','ERS Datamart Code User','$DATA_LOCATION_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER','$DATA_LOCATION_PASS','$DATA_LOCATION_SRVC' ) ] 
           } else {
               set print [exec_omb OMBCREATE LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE, CONNECT_AS_USER, PASSWORD) VALUES ('ORACLE_DATABASE','$DATA_LOCATION_VERS','ERS Datamart Code User','$DATA_LOCATION_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER','$DATA_LOCATION_PASS') ] 
           if [omb_error $print] {
              exit_failure "Unable to create location '$DATA_LOCATION_NAME'"
           exec_omb OMBSAVE
           log_msg LOG "Adding Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
           set print [exec_omb OMBALTER CONTROL_CENTER '$CONTROL_CENTER_NAME' ADD REF LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (IS_TARGET, IS_SOURCE) VALUES ('true', 'true') ]
           if [omb_error $print] {
               exit_failure "Unable to add Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
           exec_omb OMBCOMMIT
           log_msg LOG "Setting Control Center as default control center for project"
           exec_omb OMBCC 'DEFAULT_CONFIGURATION'
           set print [exec_omb OMBALTER DEPLOYMENT 'DEFAULT_DEPLOYMENT' SET REF CONTROL_CENTER '$CONTROL_CENTER_NAME' ]
           if [omb_error $print] {
              exit_failure "Unable to set Control Center $CONTROL_CENTER_NAME in default configuration"
           exec_omb OMBCOMMIT
           exec_omb OMBCC '..'
           log_msg LOG "Connecting to Control Center $CONTROL_CENTER_NAME"
           set print [exec_omb OMBCONNECT CONTROL_CENTER USE '$DATA_LOCATION_PASS' ]
           if [omb_error $print] {
              exit_failure "Unable to connect to Control Center $CONTROL_CENTER_NAME"
           exec_omb OMBCOMMIT
           log_msg LOG "Registering Code Location."
           set print [exec_omb OMBALTER LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (PASSWORD) VALUES ('$DATA_LOCATION_PASS')]
           exec_omb OMBCOMMIT
           set print [exec_omb OMBREGISTER LOCATION '$DATA_LOCATION_NAME']
           if [omb_error $print] {
              exit_failure "Unable to register Location $DATA_LOCATION_NAME"
           exec_omb OMBCOMMIT
    } else {
       log_msg LOG "Need to create Control Center $CONTROL_CENTER_NAME."
       log_msg LOG "Creating Code Location."
       log_msg LOG "Checking Global_names...."
       set dbGlobalNames FALSE
       set oraConn [oracleConnect $DATA_LOCATION_HOST $DATA_LOCATION_SRVC $DATA_LOCATION_PORT $CONTROL_CENTER_SCHEMA $CONTROL_CENTER_PASS ]
       set oraRs [oracleQuery $oraConn "select value pvalue FROM V\$PARAMETER where name = 'global_names'"]
       while {[$oraRs next]} {
         set dbGlobalNames [$oraRs getString pvalue]
       $oraRs close
       $oraConn close
       log_msg LOG "Global_names are $dbGlobalNames...."
       if [string match TRUE $dbGlobalNames] {
           set print [exec_omb OMBCREATE LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE, CONNECT_AS_USER, PASSWORD, DATABASE_NAME) VALUES ('ORACLE_DATABASE','$DATA_LOCATION_VERS','ERS Datamart Code User','$DATA_LOCATION_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER','$DATA_LOCATION_PASS','$DATA_LOCATION_SRVC' ) ] 
       } else {
           set print [exec_omb OMBCREATE LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE, CONNECT_AS_USER, PASSWORD) VALUES ('ORACLE_DATABASE','$DATA_LOCATION_VERS','ERS Datamart Code User','$DATA_LOCATION_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER','$DATA_LOCATION_PASS') ] 
       if [omb_error $print] {
          exit_failure "Unable to create location '$DATA_LOCATION_NAME'"
       exec_omb OMBCOMMIT
       log_msg LOG "Creating Control Center"
       set print [exec_omb OMBCREATE CONTROL_CENTER '$CONTROL_CENTER_NAME' SET PROPERTIES (DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE_NAME, USER, SCHEMA, PASSWORD) VALUES ('ERS Datamart Control Center','$CONTROL_CENTER_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER', '$CONTROL_CENTER_SCHEMA','$DATA_LOCATION_PASS') ]
       if [omb_error $print] {
          exit_failure "Unable to create control center '$CONTROL_CENTER_NAME'"
       exec_omb OMBCOMMIT
       log_msg LOG "Adding Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
       set print [exec_omb OMBALTER CONTROL_CENTER '$CONTROL_CENTER_NAME' ADD REF LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (IS_TARGET, IS_SOURCE) VALUES ('true', 'true') ]
       if [omb_error $print] {
          exit_failure "Unable to add Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
       exec_omb OMBCOMMIT
       log_msg LOG "Setting Control Center as default control center for project"
       exec_omb OMBCC 'DEFAULT_CONFIGURATION'
       set print [exec_omb OMBALTER DEPLOYMENT 'DEFAULT_DEPLOYMENT' SET REF CONTROL_CENTER '$CONTROL_CENTER_NAME' ]
       if [omb_error $print] {
          exit_failure "Unable to set Control Center $CONTROL_CENTER_NAME in default configuration"
       exec_omb OMBCOMMIT
       exec_omb OMBCC '..'
       log_msg LOG "Connecting to Control Center $CONTROL_CENTER_NAME"
       set print [exec_omb OMBCONNECT CONTROL_CENTER USE '$DATA_LOCATION_PASS' ]
       if [omb_error $print] {
          exit_failure "Unable to add Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
       exec_omb OMBCOMMIT
       log_msg LOG "Registering Code Location."
       set print [exec_omb OMBALTER LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (PASSWORD) VALUES ('$DATA_LOCATION_PASS')]
       exec_omb OMBCOMMIT
       set print [exec_omb OMBREGISTER LOCATION '$DATA_LOCATION_NAME']
       if [omb_error $print] {
          exit_failure "Unable to register Location $DATA_LOCATION_NAME"
       exec_omb OMBCOMMIT
    # Assign location to Oracle Module
    log_msg LOG "Assigning Code Location to Oracle Module."
    set print [ exec_omb OMBALTER ORACLE_MODULE '$ORA_MODULE_NAME' ADD REFERENCE LOCATION '$DATA_LOCATION_NAME' SET AS DEFAULT ]
    if [omb_error $print] {
       exit_failure "Unable to add reference location '$DATA_LOCATION_NAME' to module '$ORA_MODULE_NAME' "
    set print [ exec_omb OMBALTER ORACLE_MODULE '$ORA_MODULE_NAME' SET REFERENCE METADATA_LOCATION '$DATA_LOCATION_NAME' ]
    if [omb_error $print] {
       exit_failure "Unable to set metadata location '$DATA_LOCATION_NAME' on module '$ORA_MODULE_NAME' "
    set print [ exec_omb OMBALTER ORACLE_MODULE '$ORA_MODULE_NAME' SET PROPERTIES (DB_LOCATION) VALUES ('$DATA_LOCATION_NAME') ]
    if [omb_error $print] {
       lexit_failure "Unable to add db_location '$DATA_LOCATION_NAME' to module '$ORA_MODULE_NAME' "
    exec_omb OMBCOMMIT
    exec_omb OMBDISCONNECT

  • Merging Log Files with same name

    Hello,
    I have log files with same name 00000000.jdb (because created at different machines). I would like to merge data stored in these two files.
    I tried below approaches which do not work:
    1. rename one of the files -> doesn't work as file header has file name info which doesn't match with renamed value
    2. db dump/load -> dump and load works without error. (i have to dump Entity related Database and Format related Database -- from -l option) However when i try to read the file, it gives error.
    Exception in thread "main" com.sleepycat.je.EnvironmentFailureException: (JE 5.0.103) Catalog could not be refreshed, may indicate corruption, errorFormatId=52 nFormats=51, . UNEXPECTED_EXCEPTION: Unexpected internal Exception, may have side effects.
    I am using EntityStore and thus Annotated Entities.
    Does any one has any insights?
    Thanks.

    Yuvaraj,
    As you discovered, it is not possible to use .jdb files from one environment in a different environment.  The .jdb files use an internal format with relationships between files that form the Btree.
    I'm glad to hear you were able to use DbDump and DbLoad successfully.
    --mark

  • Analzing log files with external tools?

    Hi,
    is there any way to use web analytics software like Webtrends with EP? In other words, does EP produce
    an access log file with date, URL, user, referrer,
    etc.?
    Thanks in advance,
    Stefan.

    Thanks for the hint. Apparently httpaccess\responses.0.trc contains log entries that look very familiar to something an ordinary web server produces, which is good.
    A simple perl script could transform the logfile (date, etc.) into a format that a Web statistics tool on the market (e.g. WebTrends) could use.
    The SAP built-in reports are not something that drives a marketing department wild.
    Thanks,
    Stefan

  • Parsing Log file with PowerShell

    Hey Guys, I have the following line in a txt file (log file) 
    2012-08-14 18:00:00 [ERROR] . Exception SQL error 1 2012-08-14 18:10:00 [ERROR] . Exception SQL error 22012-08-15 18:00:00 [INFO] . Started 
    - Check the most recent entry(s) the last 24 hours
    - if there's an error [ERROR] write-out a statement that says (Critical) with the date-time of the error
    - If there's no erros write-out (Ok)
    So far I learned to write this much and would like to learn more from you:
    $file = "C:\Users\example\Documents\Log.txt" cat $file | Select-String "ERROR" -SimpleMatch

    Hello,
    I am new to PowerShell, and looking for same requirement, here is my function.
    Function CheckLogs()
        param ([string] $logfile)
        if(!$logfile) {write-host "Usage: ""<Log file path>"""; exit}
        cat $logfile | Select-String "ERROR" -SimpleMatch | select -expand line |
             foreach {
                        $_ -match '(.+)\s\[(ERROR)\]\s(.+)'| Out-Null 
                        new-object psobject -Property @{Timestamp = [datetime]$matches[1];Error = $matches[2]} |
                        where {$_.timestamp -gt (get-date).AddDays(-1)}
                        $error_time = [datetime]($matches[1])
                        if ($error_time -gt (Get-Date).AddDays(-1) )
                            write-output "CRITICAL: There is an error in the log file $logfile around 
                                          $($error_time.ToShortTimeString())"; exit(2)
      write-output "OK: There was no errors in the past 24 hours." 
    CheckLogs "C:\Log.txt" #Function Call
    Content of my log file is as follows
    [ERROR] 2013-12-23 19:46:32
    [ERROR] 2013-12-24 19:46:35
    [ERROR] 2013-12-24 19:48:56
    [ERROR] 2013-12-24 20:13:07
    After executing above script, getting the below error, can you please correct me.
     $error_time = [datetime]($matches[1])
    +                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray
    Cannot index into a null array.
    At C:\PS\LogTest.ps1:10 char:21
    +                     new-object psobject -Property @{Timestamp = 
    [datetime]$match ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray
    Cannot index into a null array.
    At C:\Test\LogTest.ps1:12 char:21
    +                     $error_time = [datetime]($matches[1])
    +                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray

  • How to Run Export and Make Dump and Log File with Dates on NT

    Hi Gurus,
    set ORACLE_SID=ORCL
    set ORACLE_HOME=D:\ORACLE\ora92
    for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do
    set fdate=%%a%%b%%c
    exp userid=userid/password@connectstring
    file=exp%fdate%.dmp log=exp%fdate%.log full=y
    I am using above script for export and make dump file with dates, but when i am excuting this script with Schedule task i am getting error.
    C:\Documents and Settings\krishna>for /f "tokens=2,3,4 delims=/ " %%a in ('date
    /t') do
    %%a was unexpected at this time.
    Help is highly appriciated.
    Thanks & Regards
    praveen

    HOST('EXP80 MRPAY/MRPAYS FILE=D:\BACKUP\MRPAY'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=MRPAY CONSISTENT=Y');
    HOST('EXP80 SECSYS/SECSYS FILE=D:\BACKUP\SECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SECSYS CONSISTENT=Y');
    HOST('EXP80 SICPA/SICPA FILE=D:\BACKUP\SICPA'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPA CONSISTENT=Y');
    HOST('EXP80 SICPAINVSYS/SICPAINVSYS FILE=D:\BACKUP\SICPAINVSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAINVSYS CONSISTENT=Y');
    HOST('EXP80 SICPAGLSYS/SICPAGLSYS FILE=D:\BACKUP\SICPAGLSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAGLSYS CONSISTENT=Y');
    HOST('EXP80 SICPAPURHSYS/SICPAPURHSYS FILE=D:\BACKUP\SICPAPURHSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAPURHSYS CONSISTENT=Y');
    HOST('EXP80 SICPARECSYS/SICPARECSYS FILE=D:\BACKUP\SICPARECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPARECSYS CONSISTENT=Y');
    HOST('EXP80 SICPASECSYS/SICPASECSYS FILE=D:\BACKUP\SICPASECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPASECSYS CONSISTENT=Y');
    HOST('EXP80 FASYS/FASYS FILE=D:\BACKUP\FASYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=FASYS CONSISTENT=Y');
    HOST('EXP80 ATTSYS/ATTSYS FILE=D:\BACKUP\ATTSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=ATTSYS CONSISTENT=Y');
    HOST('EXP80 ATTENDANCESYSTEM/ATTENDANCESYSTEM FILE=D:\BACKUP\ATTENDANCESYSTEM'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=ATTENDANCESYSTEM CONSISTENT=Y');
    Arshad

  • One Log File With Tomcat

    I am trying to figure out how to get all of my logging to use one log file. Currently when I start tomcat as a service it writes to stderr.log, stdout.log as well as a log file I have configured using Log4j. I would like all logs including startup/shutdown logs that are currently going to stdout.log/stderr.log to go to the file I write to using Log4j.
    If I start tomcat using catalina.bat it doesn't do this (bc it writes to the console window) but I would like to send all those startup/shutdown messages to the log that Log4j uses if I start tomcat as a service.
    Any help would be appreciated.

    That doesn't really help, because I've got Log4j already running. It looks like there is no easy solution to this. I'm left with choosing one of the three options below.
    1) Configure a <Logger> element for the Context that catches any logging not sent to the Log4j log file. This means I would have a stdout.log, stderr.log, log from the <Logger> element, and a log for Log4j. That's a lot of log files...
    2) Not configure a <Logger> element for the Context. This means any logging not sent to the Log4j file will go to either stdout.log or stderr.log. Those files could get big and aren't rotated like my Log4j file. Not exactlly ideal either.
    3) Don't install Tomcat through the .exe file. Unpackage it, set the environment variables, and set it up as a serivce through a script such as the one mentioned at http://weblogs.java.net/blog/simongbrown/archive/2003/09/installing_tomc.html setting the same file that Log4j uses for the -out and -err parameters. This means that all logging (startup/shutdown) will go to this one log file. But it also means messing with the install (deviating from the .exe) which scares me a little.
    Unless someone has a better idea...I guess it's one of the three above.
    Thanks,
    Jim

  • Cannot Display Log File with Palm E2 and Palm Desktop 4.1.4.

    I finally got the Palm Desktop 4.1.4 which works okay with Vista. I have the Palm Tungsten E2. When I sync, and when it indicates that there were some duplications, etc. and do I want to view the HTM log file, I click on view log, and it comes up unable to display/find the page! Does anyone know what is going on?
    Post relates to: Tungsten E2
    This question was solved.
    View Solution.

    Thanks for replying PALM_LOVER!
    Sometimes, yes, sometimes no. When I first sync-ed today, I got the prompt, and when i clicked on VIEW LOG, it took me to a web page that said "FILE NOT FOUND "("Firefox can't find the file at /C:/Program Files/palmOne/Stephe/HotSyncLog.htm.") I re-sync-ed and did not get the prompt.
    Post relates to: Tungsten E2

  • Create different log file with different schema by spool

    Hello,
    I want to know a way to create a different log file depend on different schema
    I have two schema on same db server
    1) schema kennam/*****/kennam
    2) schema koonhey/*****/koonhey
    by a way, I want to create a different log file name e.g. kennam.log / koonhey.log on such two schema...
    I always run @showbalance; to run showbalance.sql to create that report..
    I hope you understand what I talking about (english is not my native language........), anyone could help?
    showbalancelog.sql
    spool c:\log.log+
    spool c:\log.log
    select to_char(sysdate,'dd-mm-yyyy hh:mi:ss') from dual;
    column com_name format a20;
    select cus.tid, cus.com_name com_name, cus.com_balance,
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) sum_invoice,
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) sum_income,
    cus.com_balance -
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) +
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) total_balance
    from customers cus
    order by cus.tid;
    spool off

    okey I solved on this way, is anyone know another simpler way?
    be simpler part
    variable vspoolfile varchar2(20)
    declare
    username varchar2(20);
    spoolfile varchar2(50);
    begin
    select 'c:\' || user || '.log' into spoolfile from dual;
    -- spoolfile := 'c:\' || username || '.log';
    :vspoolfile := spoolfile;
    -- dbms_output.PUT_LINE(spoolfile);
    end;
    -- print :vspoolfile;
    column spoolfilecol new_value definespoolfile noprint
    select :vspoolfile spoolfilecol from dual;full content of my showbalancelog.sql file
    variable vspoolfile varchar2(20)
    declare
    username varchar2(20);
    spoolfile varchar2(50);
    begin
    select 'c:\' || user || '.log' into spoolfile from dual;
    -- spoolfile := 'c:\' || username || '.log';
    :vspoolfile := spoolfile;
    -- dbms_output.PUT_LINE(spoolfile);
    end;
    -- print :vspoolfile;
    column spoolfilecol new_value definespoolfile noprint
    select :vspoolfile spoolfilecol from dual;
    spool &definespoolfile;
    column com_name format a20;
    select cus.tid, cus.com_name com_name, cus.com_balance,
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) sum_invoice,
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) sum_income,
    cus.com_balance -
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) +
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) total_balance
    from customers cus
    order by cus.tid;
    spool off;

  • Need some help with ip camera port forwarding

    Setting up a ip wireless security camera to provide internet access thru a airport extreme router. Using the free ip scanner software provided with the  camera, I can see and connect to the camera on my own home network, wirelessly. I believe that port forwarding will give me access to the camera outside the local network. I'd like to be sure I am setting up the port forwarding correctly. Also if I decide to use back to my Mac in the future will this camera setup interfere with the settings?

    OK I figured out how to Port forward and how to do DHCP reservations. Unfortunately the latest 5th Gen Airport extreme software has a bug and neither ip Cam would work. Rolling back the software on the Airport to a previous version finally allowed the DHCP reservations to work. But the port forwarding or something is not working. I can not log on to the ip cams remotely or wirelessly. I may have to borrow a different Wireless router from a IT friend and disconnect the Airport Extreme, to get the cams on wirelessly. Hopefully they fix the problem some day.

  • Can I append to IIS log files with jsp?

    When we added a load balancer, our IIS logs started using its IP address in the logfile and not the client's real IP address.
    I need to add the client's real address back into the IIS logs, so our
    reports can restart having the correct session numbers.
    Does anyone know how to do this in JSP?
    I've found snippets of code that says it does this, but I'm not sure where to put the code.
    <% Response.AppendToLog "client_IP" %>
    I tried putting this in my .jsp file and it doesn't know about Response.
    I find reference to Response in the asp API, but not in the jsp API.
    AppendToLog appends this data to the URI Query field of the IIS Log.
    We are using IIS5.0.
    Sue Damitz

    Hi Jonny,
    I don't think it can be done the way you've suggested, however you can accomplish the same thing in a different way.
    Go to System Preferences > Security > General and select 'Require Password Immediately after sleep or screensaver begins'
    Then go into Energy Saver and set your Display sleep to 1 min OR go to Desktop and Screensaver and set the screensaver time to 3 mins.
    That way, once your display goes to sleep or into screen saver it will require a password to resume. This will keep the music playing in the background and also has the added benefit of displaying iTunes album artwork as the screensaver (if that's the screensaver you have selected!)

  • Errors in the /users/unison/log/das.log file with  "xitemid not unique".

    When reviewing /users/unison/log/das.log it is showing errors with
    "xitemid not unique":
    <P>
    DATE = Current date
    PID = 12492
    DEXOTEK ERRCODE Ox1800B -> ctldap_ItemGetById: ctldap_LDAPEntryGetById
    DATE = Current date
    PID = 12743
    DEXOTEK ERRCODE Ox1800B -> ctldap_LDAPEntryGetById: xItemId not unique
    <P>
    Also, when comparing the das.log to the directory server access log matching
    the timestamp from the error above, you may see errors such as the
    following:
    [23/Jun/1998:15:45:28 -0700] conn=37 op=66 SRCH base="o=Ace Industries,c=US" scope=2
    filter="(nscalxitemid=10000:00257)"
    [23/Jun/1998:15:45:28 -0700] conn=37 op=66 RESULT err=0 tag=101 nentries=1
    [23/Jun/1998:15:45:28 -0700] conn=37 op=67 BIND dn="uid=nuser1,o=Ace Industries,c=US"
    method=128 version=3
    [23/Jun/1998:15:45:28 -0700] conn=37 op=67 RESULT err=0 tag=97 nentries=0
    [23/Jun/1998:15:45:28 -0700] conn=37 op=68 SRCH base="o=Ace Industries,c=US" scope=2
    filter="(nscalxitemid=10000:*)"
    [23/Jun/1998:15:45:28 -0700] conn=37 op=68 RESULT err=4 tag=101 nentries=2
    in which an err= 4 is LDAP SIZELIMIT EXCEEDED. This means that the search
    resulted in multiple entries with the same ID, so the server does not
    know which value to return.
    <P>
    These log entries might be due to duplicate or multiple nscalxitemid attributes
    in a replicated directory server, i.e., each calendar enabled user and resource
    is suppose to have a single, unique nscalxitemid attribute.
    <P>
    An example attribute entry in the LDAP database of user 00257 on
    node 10000 would be:
    <P>
    nscalxitemid: 10000:00257
    <P>
    To identify these duplicate or multiple nscalxitemid attributes, use the new calendar
    server tool, unidsdiff, which can be downloaded from
    http://help.netscape.com/business/filelib.html#caltools.

    amaltsev1,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

Maybe you are looking for

  • Touch screen not working with internet link in safari

    Anyone has the same problem? After 1.1.1 update, my touch screen occassionally fails to respond any tap on internet links in safari. no matter which web site you go to, no link will work on tap. I tried to clean catch, cookies, etc. The only way to o

  • OT: PHP mail issue

    I have the following code for sending an email - $message="Line1\n\r"; $message.=$row_rsContact['contactFName'].' '.$row_rsContact['contactLName'].' User#'.$row_rsContact['contactRecord']."\n\r"; $message.="Email - ".$row_rsContact['contactEmail']."\

  • How to change file type from .zip to .dock

    I would like to know how to change the saved file type (.zip) to other file types such as (.txt), (.doc), (.dock) or (.pdf).

  • How do i see the thumbnails when using File Explorer

    How do I get to see the thumbnail preview when using File > Open?

  • ROLAP and MOLAP sources for APEX

    Hi All, Was interested in knowing 1) if APEX can query ROLAP objects (tables) from a relational schema ? 2) if APEX can query MOLAP objects (cubes) from a AWM(analytical workspace manager) schema ? Any help would be appreciated. Thanks, Sam. Edited b