Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
In 7.2 and future releases the agentcmd has extra logging enabled, you are able to remove some of these logs by adding switches to the agentcmd command but the first line is always there:

...

2013-09-19 12:50:04,398 - Threads having sessions open longer than 4.00s will be logged when a thread dump is asked for
  
 
As this output will show in your script results before any of the data from the agent output it can cause issues with monitors to .
To remove this data do the following:
 
1. Edit the agentcmd.jcnf file in the scripts directory of the monitoring station:
 
Code Block
In the following section:

...


[jvm.additional.args]

...


-d64

...

 

...



Add:

...


-Dlog4j.configuration=file:///usr/local/uptime/scripts/log4j.properties

...



So should now see:

...


[jvm.additional.args]

...


-d64

...


-Dlog4j.configuration=file:///usr/local/uptime/scripts/log4j.properties

...


 

...


2. Create the log4j.properties file in the scripts directory and add the following code to it.

...

  

...


log4j.rootLogger=WARN,

...

  

...

#console logger

...

 THIRDPARTY

#console logger
 log4j.appender.CONSOLE=org.apache.log4j.RollingFileAppender

...


 log4j.appender.CONSOLE.MaxFileSize=10MB

...


 log4j.appender.CONSOLE.MaxBackupIndex=0

...


 log4j.appender.CONSOLE.File=logs/uptime_scripts.log

...


 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout

...


 log4j.appender.CONSOLE.layout.ConversionPattern=%d | %p | %X{context} | %t | %c |

...

  

...

#third party code logger - thirdparty.log

...

 %m%n

  
 #third party code logger - thirdparty.log
 log4j.appender.THIRDPARTY=org.apache.log4j.RollingFileAppender

...


 log4j.appender.THIRDPARTY.MaxFileSize=10MB

...


 log4j.appender.THIRDPARTY.MaxBackupIndex=0

...


 log4j.appender.THIRDPARTY.File=logs/thirdparty.log

...


 log4j.appender.THIRDPARTY.layout=org.apache.log4j.PatternLayout

...


 log4j.appender.THIRDPARTY.layout.ConversionPattern=%d | %p | %X{context} | %t | %c | %m%n
  
 3. Now you should be able to run the agentcmd and see only your agent output rather than this log info, instead it is redirected to logs/uptime_scripts.log to a file set to roll when hits 10mb and not keep any historical copies so should only ever be 10mb at most.