Problem cycling logfiles

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Problem cycling logfiles

  • Creator
    Topic
  • #52005
    Graham Hartley
    Participant

      I am having trouble cycling the log files for certain processes.  The code below (details from cmd prompt) works with some processes but not all.  The process is alive and when I try and cycle it from the Network monitor it works.  I am just trying to automate the process.  I have tried rebooting the server but this has no effect.

      Code:


      Microsoft Windows [Version 5.2.3790]
      (C) Copyright 1985-2003 Microsoft Corp.

      d:quovadxqdx5.3integratorproduction>hcitcl
      hcitcl>set process AE_CDS
      hcitcl>exec hcicmdnt -p $process -c “. output_cycle” -v
      Error: getting port from:  d:quovadxqdx5.3integratorproductionexecprocesse
      sAE_CDScmd_port
      Obtained port:  1501
      Reading 4 byte length
      Reading 3 byte response
      Reading 4 byte length
      Read failed:  WSA error 10060
      Failed to get response from process AE_CDS

      Any suggestions as to what may be causing the problem or if there is a more appropriate command to cycle the logs, would be gratefully received.

      Thanks in advance,

      Graham

      [/code]

    Viewing 11 reply threads
    • Author
      Replies
      • #72663
        Keith McLeod
        Participant

          Have you tried Automatic Log Cycling?

          1) Open NetConfig

          2) Click on Process

          3) Click on Configure

          4) Clcik check box for Automatic Log Cycling

          5) Set to desired size that you would like to cycle the log file at.

          6) Cycle Process to enable

          If you want to maintain more than current and .old, you can use an alert to check for file change on the .old files created and have a script to copy off with a date.

          I set mine to 50000 per process which in effect saves 100MB per process.  This is your preference….

        • #72664
          David Harrison
          Participant

            I’m on unix and Cloverleaf 5.6 and this works for me

            Code:

            hcicmd -p process -c “thread save_cycle in”

          • #72665
            Graham Hartley
            Participant

              Thanks for your suggestions thus far.  I havent tried the Automatic Log cycling yet.  However I would still like to know why the approach I am taking dosent always work.  The reason for taking this approach is that I would like to create a script to cycle the logs on a daily basis.

            • #72666
              Russ Ross
              Participant

                With regards to the error you posted:

                Error: getting port from:

                Russ Ross
                RussRoss318@gmail.com

              • #72667
                Russ Ross
                Participant

                  Here is the cycle_process_logs.ksh script I wrote and have been using for many years to cycle all process logs near midnight:

                  Code:

                  #!/usr/bin/ksh

                  # Begin Module Header ==============================================================================
                  #
                  #——
                  # Name:
                  #——
                  #
                  # cycle_process_logs.ksh
                  #
                  #———
                  # Purpose:
                  #———
                  #
                  # Cycle the log files for every process in the $HCISITEDIR/NetConfig file
                  #
                  #——–
                  # Inputs:
                  #——–
                  #
                  # none
                  #
                  #——-
                  # Notes:
                  #——-
                  #
                  # This script assumes the proper environment is set when it is called
                  #
                  # Example of normal cron usage:
                  #
                  # refer to crontab entries for user hci
                  #
                  # Even though you can use the NetConfig to cycle logs when they get too large,
                  # this script is helpfulull to prevent false alarms at midnight when the stats
                  # for the threads get initialized.
                  #
                  #———
                  # History:
                  #———
                  #
                  # 2000.07.31 Russ Ross
                  #          – wrote initial version.
                  #
                  # End of Module Header =============================================================================

                  #———————————————–
                  # get the list of processes for the current site
                  #———————————————–

                     PROCESSES=`grep process $HCISITEDIR/NetConfig | awk ‘{print $2}’`

                  #———————————————————
                  # cycle the log files for each process in the current site
                  #———————————————————

                     for proc in $PROCESSES
                     do
                         hcicmd -p $proc -c ‘. output_cycle’ > /dev/null 2>&1
                     done

                  Russ Ross
                  RussRoss318@gmail.com

                • #72668
                  Graham Hartley
                  Participant

                    Thanks Russ.  The files you suggested are re-created when the process is restarted.  The strange thing is that the logfile still gets cycled even though this error is returned.  I guess I can just carry on using the same command but just ignore the error.  However I would still like to know what causes it.

                    Regards,

                    Graham

                  • #72669
                    Garrett Fletcher
                    Participant

                      Graham,

                      How are you trying to execute this script?

                      I have a script to cycle log files I call in through a upoc. I used to have a call to ‘hcicmdnt -p process -c “. cycle_output” ‘ in my script, but when I executed it through the upoc I would get this error. Maybe it doesnt like it when you try to cycle the process from within the process?

                      G

                    • #72670
                      Chris Williams
                      Participant

                        Graham is seeing the log files still getting cycled because that is part of the process’s startup.

                        The more important question is why would you want to cycle the logs as part of processing a message? In Unix you would run the hcicmd code as a cron job. In Windows you would use Scheduled Tasks.

                        Chris

                      • #72671
                        Garrett Fletcher
                        Participant

                          In my situation we deploy a lot of Cloverleaf installs to our customers. When we have someone else log in to support our installs I like everything to be contained in the Cloverleaf Site, so it is cleaner and easier to support. What I am planning to do is put a  thread calle archive_logs in a process called archive, and have that run for each site. That way it is visable to anyone who goes in to support it.

                          Here is the script I wrote, along with how I set it up. I am still testing it, but it is working fine right now.

                          The script takes no input, it gets the list of processes and threads from netconfig, it only runs for the site you place it in, and it is set up for windows right now (I think all you have to do to make it run in _NIX is replace hcicmdnt with hcicmd). Also you can set the time period on how far back you want to delete the archive in the tcl script.

                        • #72672
                          Garrett Fletcher
                          Participant

                            Ok I had to change the way the proc was triggered. For some reason it does not like running in advanced scheduling.

                            See the screenshots for steup.

                            Also logs are archived here:

                            %hciroot%/%site%/archive

                          • #72673
                            John Mercogliano
                            Participant

                              Graham,

                               Just to explain your log cycling.  The reason it is still cycling even though you get the error is because the command sets up a socket timeout event.  So, the monitord is accepting your command it is just not processing the cycle command fast enough, so the timeout trigger is fired.  But that doesn’t affect what you sent to the monitord. It just keeps process it to completion.  

                                Now the timeout is 30 seconds so the only reason that I was encountering this was when I was cycling very large log files.  So, look at your at your log and error files and see if they can be cleaned up for those processes.  Otherwise, you might want to cycle more then once per day for those processes.

                              Hope that helps,

                              John Mercogliano
                              Sentara Healthcare
                              Hampton Roads, VA

                            • #72674
                              Graham Hartley
                              Participant

                                Thanks everybody for your help on this.  I will try out some of your suggestions and let you know how I get on.

                                Your help is much appreciated,

                                Regards,

                                Graham

                            Viewing 11 reply threads
                            • The forum ‘Cloverleaf’ is closed to new topics and replies.