NXLog Linux - Remove Files After Processing - nxlog

I am deploying nxlog on a Linux server (Red Hat Enterprise release 6.6). I am currently trying to remove a file after nxlog has finished processing. From the nxlog documentation, I am using file_remove, which is not working. Here is my config that does not throw any syntax errors when starting nxlog. As seen, I used a time interval of every 1 minute as I do not know the best way to have the file deleted after processing. In the debug log, I do not see an attempt to try and match files in the directory for removing:
########################################
# Global directives #
########################################
User nxlog
Group nxlog
LogFile /var/log/nxlog/nxlog.log
LogLevel DEBUG
########################################
# Modules #
########################################
<Extension _syslog>
Module xm_syslog
</Extension>
<Extension fileop>
Module xm_fileop
<Schedule>
Every 1 min
Exec file_remove('/eventarchive/processed/*.raw', (now()));
</Schedule>
</Extension>
<Input in1>
Module im_file
File "/eventarchive/processed/*.raw"
SavePos TRUE
#Exec parse_syslog_bsd();
</Input>
<Output fileout1>
Module om_udp
Host 10.102.103.112
Port 3333
Exec to_syslog_bsd();
</Output>
########################################
# Routes #
########################################
<Route 1>
Path in1 => fileout1
</Route>
I used this same syntax on a Windows setup to test it, which worked; it successfully removed files. On the Linux setup, I have also tried setting a filename instead of "*.raw" but that did not work either. Is there something I'm doing wrong? Does anyone know if there are any limitations with Linux that would stop this from working?
Does anyone know the best way to configure nxlog to remove a file after processing, as opposed to setting a time interval of 1 second like above?
Thanks in advance!

See the response in the NXLog forums.

Related

The server exited prematurely with exit code 1 GlassFish 4

I've been trying to start the glassfish server domain with the following command asadmin start-domain domain1 but the result wasn't the expected. This what the outputs is throwing out:
Waiting for domain1 to start .Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
Command start-domain failed.
Btw I've already tried changing the network-listener-port number located inside glassfish folders C:\glassfish4\glassfish\domains\domain1\config\domain.xml from port 8080 to 4949 and it didn't work. Besides I also tried running the start-domain domain1 command in the asadmin batch file and nothing happened, the output still the same.
Any idea how can I fix this out?
I tried to start it with asadmin.sh and it worked on Windows 10

Rename WinPE hostname

I am trying to get my WinPE environment to rename itself, I currently have a WinPE .wim that I use to deploy through a WDS server, it configures the disks and deploys the same WinPE environment into one of the partitions and makes it bootable. However I am needing the not bootable on disk WinPEs hostname to be changed from the random computer name "MININT-******" into what I need.
I have tried an unattend.xml and run wpeinit.exe /unattend:[path to unattend.xml]
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>ASDF1234</ComputerName>
</component>
</settings>
</unattend>
I have tried many variations of the unattend.xml and every one in the wpeinit log file says
WPEINIT is processing the unattend file [Path]
==== Initializing Display Settings ====
No display settings specified
STATUS: SUCCESS (0x0000001)
==== Initializing Computer Name ====
Generating a random computer name
No computer name specified, generating a random name.
Renaming computer to MININT-*******.
Waiting on the profiling mutex handle
Acquired profiling mutex
Service winmgmt disable: 0x0000000
...
Everything works at this point except renaming the system, when using Rename-Computer with powershell it works but once it reboots it runs the wpeinit again which generates a random name it seems.
Any help would be much appreciated!
I never handled to change this at this point.
However - I change the Hostname after booting via startnet / Registry:
#echo Windows Registry Editor Version 5.00 > set_hostname.reg
#echo\ >> set_hostname.reg
#echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters] >>
#echo "Hostname"="NEW_HOSTNAME" >> set_hostname.reg
#echo "NV Hostname"="NEW_HOSTNAME" >> set_hostname.reg
#echo\ >> set_hostname.reg
regedit /s set_hostname.reg >nul

Doesnt find MSBuild.SonarQube.Internal.PostProcess.exe

Unable to execute sonar run for ms build when i change the sonar host from localhost to my machine ip.
tried changing the host in sonar.properties file and also in sonarqube_analysis.xml.
c:\HID\project-test\PACS\sonar_opencover\Project>MSBuild.SonarQube.Runner.exe end
Default properties file was found at C:\HID\project-test\dotnet\MSBuild.SonarQube.Runner-1.0.1\SonarQube.Analysis.xml
Loading analysis properties from C:\HID\project-test\dotnet\MSBuild.SonarQube.Runner-1.0.1\SonarQube.Analysis.xml
Post-processing started.
Execution failed. The specified executable does not exist: c:\HID\project-test\PACS\sonar_opencover\Project\.sonarqube\bin\MSBuild.SonarQube.Internal.PostProcess.exe
Post-processing failed. Exit code: 1
Scripts i executed
#call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
MSBuild.SonarQube.Runner.exe begin /k:"jenkins_test5" /n:"jenkins_test5" /v:"1.0" /d:sonar.cs.opencover.reportsPaths="%CD%\opencover.xml"
msbuild.exe
"C:\HID\project-test\PACS\sonar_opencover\opencover.4.6.210\OpenCover.Console.exe" -output:"%CD%\opencover.xml" -register:user -target:"vstest.console.exe" -targetargs:"UnitTestProject1\bin\Debug\UnitTestProject1.dll"
MSBuild.SonarQube.Runner.exe end
I ran into this issue today. Turns out that I had miss configured SonarQube.Analysis.xml. Essentially, it expects
<Property Name="sonar.host.url">http://{server}:9000/sonar</Property>
including /sonar (which comes from sonar.web.context setting of sonar.properties on the server).
I had missed out /sonar in SonarQube.Analysis.xml and had exact same symptom as yours.
I have this error because the sonarcube url is wrong, it can't connect to the conarcube host:
<Property Name="sonar.host.url">http://{server}:{Port}</Property>
After asking my colleague I found that the url has changed, I correct the url and it works succesfully.

Run Intraweb .so on apache

I made a stand alone app and it works find Intraweb 9.4.2'
Create an apache 2 .so
project info ---
library DartsDLL;
uses
ApacheTwoApp,
IWInitApacheTwo,
DLogin in 'DLogin.pas' {IWForm1: TIWAppForm},
ServerController in 'ServerController.pas' {IWServerController:
TIWServerControllerBase},
UserSessionUnit in 'UserSessionUnit.pas' {IWUserSession: TIWUserSessionBase},
DartDM in 'DartDM.pas' {dm: TDataModule},
plyrshow in 'plyrshow.pas' {plyrs: TIWAppForm},
plyrdetail in 'plyrdetail.pas' {weekdtail: TIWAppForm},
NPlyr in 'NPlyr.pas' {FrmNewPlyr: TIWAppForm},
pidlweeks in 'pidlweeks.pas' {Tseasweeks: TIWAppForm};
{$E so}
{$R *.res}
exports
apache_module name 'webdarts_mod';
begin
IWRun;
end.
conf files have been modified
httpd2.pas has been modified
apache restarts ok.
I get no errors in apache logs.
When I try to run inside delphi I get:
Can not run unless host application is defined.
Question how do you run it?
From the menu open Run Parameters and set the host application to C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe or the path where you installed Apache httpd. Another tip is to add -X to the parameters to force Apache httpd to run from a single process to not confuse the debugger.
Looking at project files the two important items are library DartsDll and apache_module name 'webdarts_mod'.
Presuming project compiles DartsDll.so will be created along with apache_module name.
Notice where apache_module name and library are used in LoadModule directive and where library name is used without ext in SetHandler.
Next you need to modify Apache httpd.conf file by adding four lines as follows;
LoadModule webdarts_mod modules/Dartsdll.so
< Location /??????>
SetHandler DartsDll-handler
< Location>
Replace the question marks with anything you desire (except any name you have already used as a apache alias) I used 'guessd'
You must copy the DartsDll.so file to the apache modules directory.
Restart Apache.
In browser just enter - localhost/guessd
If your apache has been configured correctly your .so(dll) will run.

Configuration Issues with PECL and PHP-FPM

I'm using Ubuntu Natty. I recently installed NGINX 1.0.6 and PHP 5.3.8 (with --enable-fpm) from source. Everything went ok and I tested it with an info.php page with phpinfo().
I then installed APC and Memcache using PECL i.e. pecl install apc, etc. That seemed to go ok as well.
However, when I edit my php.ini file and add the extension_dir and extension modules for both APC and Memcache, I get the following when I restart PHP.
Starting php-fpm PHP Warning: Module 'apc' already loaded in Unknown on line 0
<br />
<b>Warning</b>: Module 'apc' already loaded in <b>Unknown</b> on line <b>0</b><br />
PHP Warning: Module 'memcache' already loaded in Unknown on line 0
<br />
<b>Warning</b>: Module 'memcache' already loaded in <b>Unknown</b> on line <b>0</b><br />
done
When I open the info.php file to check what loaded, everything seems ok i.e. I see APC and Memcache references in the information.
But when I uncomment the extensions i.e. ;extension=apc.so and ;extension=memcache.so, there are no errors, but the APC and Memcache listings in PHPinfo no longer appear.
I'm not sure how these extensions are being loaded twice and from where. I'd appreciate some guidance.
Thanks in advance.
EDIT
I'm using PHP-FPM and using lsof -i -P it appears that I have multiple pools of PHP-FPM running. Could this be part of the problem why I am seeing this error?! Is there a way to fix this?!
When you run: php --ini, do you get this:
Configuration File (php.ini) Path: /etc/php5
Loaded Configuration File: /etc/php5/php.ini
Scan for additional .ini files in: /etc/php5
Additional .ini files parsed: /etc/php5/php.ini
If yes, you should re-run your configure script so not to specify the additional ini file directory.