NLog Syslog configuration files - configuration

I am trying to setup syslog in an asp.net core 2.2 project, but I can't find anything that explains this. The sample code on NLog.Target.Syslog doesn't explain enough for a newbie. I have setup logging to file using example code.
<target xsi:type="Syslog" name="cee-udp">
<sl:layout xsi:type="SimpleLayout" text="#cee: {"message": "${message}"}" />
<sl:messageCreation>
<sl:facility>Local4</sl:facility>
<sl:rfc>Rfc5424</sl:rfc>
<sl:rfc5424>
<sl:hostname xsi:type="SimpleLayout" text="${machinename}" />
<sl:appName xsi:type="SimpleLayout" text="DAEMON.MyAppName" />
<sl:procId xsi:type="SimpleLayout" text="${processid}" />
<sl:msgId xsi:type="SimpleLayout" text="${threadid}" />
<sl:disableBom>true</sl:disableBom>
</sl:rfc5424>
</sl:messageCreation>
</target>
Can you please explain what I should be putting for machinename - is that the target host or the source? How do I specify the IP of the syslog server? What is process and threadID and where is it getting the variables from?
I have Virtual Syslog Server running on another machine to test this.

just add this config target to section in Nlog.config file of your project :
<target xsi:type="Syslog" name="syslogTarget">
<sl:layout xsi:type="SimpleLayout" text="${message}" />
<sl:messageSend>
<sl:udp server="127.0.0.1" port="514" connectionCheckTimeout="0" />
</sl:messageSend>
</target>

Related

Google Omaha installer hangs

I'm trying to get Google Omaha to work, and even though I feel I'm really close for some reason it is not.
I've read the few guides and tutorials available online for it and finally managed to get the client built. I've also installed the docker package provided by Crystalnix and as far as I can tell everything is setup as it should.
For some reason however the installation process gets stuck after the API request for the package information is made.
The last response from the server looks as follows:
<response protocol="3.0" server="prod">
<daystart elapsed_seconds="62157" elapsed_days="4372"/>
<app status="ok" appid="{XXX-XXX-XXX}">
<updatecheck status="ok">
<urls>
<url codebase="http://updates.example.com/static/media/build/Product/stable/win/78065329307666/"/>
</urls>
<manifest version="71.0.57.18">
<packages>
<package required="true" hash="6uZwsU9+WCZ1oR3ovGnFyrTCqhM=" name="install.exe" size="59309528"/>
</packages>
<actions>
<action successsaction="default" run="install.exe" event="install"/>
</actions>
</manifest>
</updatecheck>
</app>
</response>
After this request is being retried for three times the installer hangs with this error: Unable to connect to the Internet. If you use a firewall, please whitelist ProductUpdate.exe
What could the issue for this be?
LE: this is the complete Omaha log file https://pastebin.com/QALnk7X7

How to send junit report via email as report doesn't display

I have a Junit HTML Report below in my local which is built through ANT:
Now the problem I am having is that if I try and attach this report by simply sending just the index.html, it will display this:
I want to know how can I send the above report via email so everyone can see the html report. I only want to send the index.html I don't want to send everybody the corresponding files.
The xml code to build this report is below (I xxx out some things which are not xxx in the real file):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="Test_Report" name="Test_Report">
<target name="xxx_SoapUI">
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat">
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg>
</exec>
</target>
<target name="xxx_SoapUI">
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat">
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg>
</exec>
</target>
<target name="xxx_SoapUI">
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat">
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg>
</exec>
</target>
</project>
The format="frames"attribute normally generates separate files for frames and maybe stylesheets. As mentioned in the task documentation, you can set the value to noframes and Ant will generate the report in a single HTML:
The noframes format does not use redirecting and generates one file called junit-noframes.html.
In case you need to customize the XSL used to generate the report, you can override it using the styledir attribute (note that the file must be named junit-noframes.xsl). The default XSL is embedded in the Ant source code and can be viewed here.
Here is alternative approach.
In this approach, do not use any attachment of the test result. Instead, host the result in a container such as tomcat or WebDAV.
Here is the example for tomcat(should be something similar for WebDAV as well):
Install tomcat
Create a directory say reports under TOMCAT_HOME\webapps directory and make sure tomcat is started.
After generating reports using current ant target, create new target for moving current reports under TOMCAT_HOME\webapps\reports\<timestamp>
Send the reports link in the email. The report link could be http://<hostname>:<port>/reports/<timestamp>/index.html
This way, every one can access the report online.

Connect Bluemix liberty container with Bluemix Session Cache service

I am trying to get the Bluemix Liberty container connect and use the Bluemix Session cache service.
What I did so far:
Create bridge application and add Session cache service
Create Liberty container and connect with bridge application
Followed this link: http://www.ibm.com/developerworks/cloud/library/cl-sessioncache-app/index.html to get a sample Application using Session caching and being able to see progress in the Service overview dashboard
Installed Websphere Extreme scale inside the liberty container and verified that feature is activated by liberty server and can be used.
Now if I try to use the application and navigate with the browser to the contextRoot I am getting the following Exceptions:
com.ibm.ws.xsspi.xio.exception.InvalidXIORefException <br />
Source = com.ibm.ws.xsspi.xio.actor.XIORegistry <br />
probeid = 659<br />
Stack Dump = com.ibm.ws.xsspi.xio.exception.InvalidXIORefException [originating=127.0.0.1:0;exid=79]: unable to find actor at index=17 <br />
com.ibm.ws.xsspi.xio.exception.InvalidXIORefException<br />
Source = com.ibm.ws.xsspi.xio.actor.XIORegistry<br />
probeid = 651<br />
Stack Dump = com.ibm.ws.xsspi.xio.exception.InvalidXIORefException [originating=127.0.0.1:0;exid=64]: XIORef at 17 does not have the same id as target xioref
java.lang.RuntimeException<br />
Source = com.ibm.ws.xs.sessionmanager.GridAvailability.run<br />
probeid = 164<br />
Stack Dump = java.lang.RuntimeException: org.omg.CORBA.TRANSIENT: java.net.SocketTimeoutException: connect timed out
I am providing all the required values, e.g. objectGridName, catalogHostPort Hardcoded inside the server.xml since the environment variables to fetch the service information like documented were also not working.
Any hints or solutions to this? Where am I missing the crucial connection so that it magically works?
Update: server.xml
<featureManager>
<feature>webProfile-6.0</feature>
<feature>eXtremeScale.webapp-1.1</feature>
<feature>icap:appstate-1.0</feature>
</featureManager>
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="443" />
<keyStore id="defaultKeyStore"
password="Liberty" />
<xsWebApp id="mysession"
objectGridName="value of session credential gridName"
objectGridType="REMOTE"
catalogHostPort="value of session credential catalogEndPoint"
securityEnabled="true"
credentialGeneratorClass="com.ibm.websphere.objectgrid.security.plugins.builtins.UserPasswordCredentialGenerator"
credentialGeneratorProps="value of session credential username and password"
/>
<httpSession idReuse="true" />
<application name="sessionCacheSample" context-root="/" location="sessionCacheSample.war" type="war"/>
it sounds like the client connectivity issue, that cannot connect from the client app to the docker container.
So, docker container running the https session web app? and it points to BM session cache service? Is this the use case? if yes, the problem could be the connectivity between the docker container and the session cache server. please comfirm.

Questions about add firewall exception in wix installer by firewall extension

I am new to Wix installer. I am trying to add firewall exception for my program.
My code is as follow:
<Component Id="_VIEW.EXE" Guid="*" Transitive="yes">
<File Id="view.exe"
Name="view.exe"
KeyPath="yes"
Source="$(var.INSTALLSOURCE)\view.exe">
<fire:FirewallException Id="view_firewall_domain_tcp"
Name="View"
Protocol="tcp"
Scope="any"
IgnoreFailure="yes"
Profile="domain" />
<fire:FirewallException Id="view_firewall_domain_udp"
Name="View"
Protocol="udp"
Scope="any"
IgnoreFailure="yes"
Profile="domain" />
<fire:FirewallException Id="view_firewall_private_tcp"
Name="View"
Protocol="tcp"
Scope="any"
IgnoreFailure="yes"
Profile="private" />
<fire:FirewallException Id="view_firewall_private_udp"
Name="View"
Protocol="udp"
Scope="any"
IgnoreFailure="yes"
Profile="private" />
</File>
</Component>
In my code, I add 4 firewall exception and each exception has different value for "Profile" and "Protocol" attributes. My expected result is 4 exceptions created:
NAME GROUP Profile Enabled Action Override Program Local Address Remote Address Protocol Local Port Remote Port Allowed Users Allowed Computers
view Domain Yes Allow No c:\test\view.exe Any Any TCP Any Any Any Any
view Domain Yes Allow No c:\test\view.exe Any Any UDP Any Any Any Any
view Private Yes Allow No c:\test\view.exe Any Any TCP Any Any Any Any
view Private Yes Allow No c:\test\view.exe Any Any UDP Any Any Any Any
But the actual result is only one exception is created and the value of "Protocol" attribute is "any" instead of "TCP" or "UDP":
NAME GROUP Profile Enabled Action Override Program Local Address Remote Address Protocol Local Port Remote Port Allowed Users Allowed Computers
view Domain Yes Allow No c:\test\view.exe Any Any Any Any Any Any Any
So, I have two questions:
Why is only one exception created? Must the name of the exception be unique?
Why does the value of the "Protocol" attribute not take effect?
I refer an official document about firewall extension:
http://wixtoolset.org/documentation/manual/v3/xsd/firewall/firewallexception.html
In the document, I saw some description about "File" attribute:
Identifier of a file to be granted access to all incoming ports and protocols. If you use File, you cannot also use Program.
If you use File and also Port or Protocol in the same FirewallException element, the exception will fail to install on Windows XP and Windows Server 2003. IgnoreFailure="yes" can be used to ignore the resulting failure, but the exception will not be added.
Does it mean that if I set firewall rule for a program, the "Protocol" and "Port" attributes will be "Any" automatically even I set "Protocol"?
The existing wix FirewallException custom actions make use of the XP/Server2003 windows firewall API. In this API, setting a firewall exception for a particular executable implies that all ports and all protocols will be opened to the exception.
For reference, the XP/Server2003 firewall API interfaces. Notice that INetFwOpenPort has the ability to get/set the port, while INetFwAuthorizedApplication does not.
If you want to create a firewall exception on a program and explicitly limit the port, protocol, and domain you'll need to make use of the windows 'advanced' firewall API that came with Vista. Check out these references:
Highlevel overview
Reference guide
Command-line reference guide
Sadly, nobody has yet implemented an AdvancedFirewallException extension for wix that makes use of these updated APIs. Maybe I'll run a kickstarter campaign to see if there interest in funding the development ;P
Try to use different Names for each FirewallExeption ID. This worked for me:
<File Id="sample.exe"
Name="sample.exe"
Source="..\TestFrame\bin\debug\sample.exe"
Vital="yes"
KeyPath='yes'>
<fire:FirewallException Id="FirewallDomainSampleTcp"
Name="Domain Sample TCP"
Protocol="tcp"
Port="8080"
Scope="any"
IgnoreFailure="yes"
Profile="domain" />
<fire:FirewallException Id="FirewallDomainSampleUdp"
Name="Domain Sample UDP"
Protocol="udp"
Port="8080"
Scope="any"
IgnoreFailure="yes"
Profile="domain" />
<fire:FirewallException Id="FirewallPrivatSampleTcp"
Name="Private Sample TCP"
Protocol="tcp"
Port="8080"
Scope="any"
IgnoreFailure="yes"
Profile="private" />
<fire:FirewallException Id="FirewallPrivateSampleUdp"
Name="Private Sample UDP"
Protocol="udp"
Port="8080"
Scope="any"
IgnoreFailure="yes"
Profile="private" />
</File>

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM’

I have an ASP.NET web application written in VB.NET. One part of the application makes an AJAX call to an internal ASMX file which in turn makes a call to a remote web service which is just a single ASMX file. Normally this works fine and has been deployed a couple of times and works fine. One client however, is getting the message from the AJAX call:
The HTTP request is unauthorized with client authentication scheme
'Anonymous'. The authentication header received from the server was
'NTLM’.
I have scoured a large amount of websites trying to fix this but I can’t seem to find any answer that works for me.
I have been unable to replicate the error on my test server, which is the same as the client, Win2003 IIS6.
The remote web service is deployed on Windows 2008 r2 – IIS7.5. The remote service is deployed using ‘Anonymous’ authentication only. The client deployment is set up with Anonymous and ‘Integrated Windows Authentication’. I have tried changing the authentication levels on both implementations but cannot replicate the issue. The closest I have come is when I set the remote service IIS authentication to
The HTTP request is unauthorized with client authentication scheme
'Ntlm'. The authentication header received from the server was ''.
In the web.config file the reference to the remote service is:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SVCMappingSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://svc.website.com/services/myService.asmx" binding="basicHttpBinding" bindingConfiguration="SVCMappingSoap" contract="SVCMappingService.SVCMappingSoap" name="SVCMappingSoap"/>
</client>
</system.serviceModel>
I have tried changing a number of the setting in the <security> section but still unable to replicate.
I am not sure of your total server setup.
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
</security>
instead of above one please try with below configuration
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm"/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
please go through below links, you can more idea on those and you can change the config based on your requirements:
http://blogs.msdn.com/b/publicsector/archive/2005/10/19/482833.aspx
http://fczaja.blogspot.com/2009/10/http-request-is-unauthorized-with.html
http://ddkonline.blogspot.com/2009/11/fix-http-request-is-unauthorized-with.html
I had to change the default generated
<security mode="Transport"/>
into
<security mode="Transport" >
<transport clientCredentialType="Ntlm"/>
</security>
One more comment for this problem:
If you are not using HTTPS,
<security mode="Transport"/>
is not supported. You can use
<security mode="TransportCredentialOnly">
instead.