DotTrace detaches after sent start command - dottrace

I am attempting to use the DotTrace command line tool self profile my application (I would use the NuGet, but it has a blocking bug.)
It starts up just fine. I create the dotTrace process and attach it to my application. I then use standard in to send it the "##dotTrace["start"] command. I have done this in a demo app and my real app. In the demo app, it starts profiling after that command is sent.
In my real app it responds with "##dotTrace["disconnected"... as if I had sent a ##dotTrace["disconnect"] command.
It does not give any indication why it detached, just does it as if I had requested it.
How can I figure out why detach was called?

Looks like the profiler crashed just after start. Could you please add --core-log-mask=55 to the dotTrace command line? It will generate a log file in %temp%\JetLogs. Please, share the folder JetLogs after that.

Related

How to replace IotCoreDefaultApp startup permanently. It returns as headed-startup after reboot (sometimes)

Using the newest Windows-10 Iot-Core on a RaspberryPi, I can replace the (single) headed startup/default App via PowerShell command "IotStartup add headed" or I can use the AppXManager to achieve the same. Then I reboot, and the new default/startup headed app appears in the AppXManager as it should.
Sometime later, my Watchdog headless process (background task) then decides to reboot (using ShutdownManager.BeginShutdown(ShutdownKind.Restart, new TimeSpan(0));). After the reboot, the DEFAULT/ORIGINAL IotCoreDefaultApp is sometimes (but not always!) returned to its status as startup app and the headed startup app that I explicitly setup is not started.
How can I assure that IoT-Core does not replace my headed-startup app with the default one upon reboot? I'd prefer not to delete the IoTCoreDefaultApp permanently at this stage in development.
This appears to work now in the newest update-release of iot-core. One can either use the Device-Portal or the "iotstartup" command in powershell. Also, if required, the scripts that handle the default AppStartup are now in C:/AppInstall.
Try to use the IoT Core Dashboard App to connect to your device. And then use the admin page to select the startup App. HTH

InstallShield 2014, Custom Actions and executing sql files into MySQL

I am building an installer for our product which works well. I've managed to build custom actions to install our services including a MySQL server.
The problem I have is executing a sql file to build the schema structures.
I have a custom action which uses mysql.exe and the command line arguments:
--port=### --user=### --password=### < "[INSTALLDIR]db\EmptyStruct.sql"
It tries to execute this ok but the cmd window which pops up, during the install, just runs through the mysql.exe command line options, which says to me that the command line it gets passed is not correct. However if I run the command manually after the install, it works perfectly.
Does anyone has any ideas please.
I'm making a few assumptions here:
You have a Windows Installer exe custom action that specifies mysql.exe and a command line as you showed
You are expecting the contents of [INSTALLDIR]db\EmptyStruct.sql to be redirected to mysql.exe's standard input
This will not happen. Behind the scenes, Windows Installer's exe custom action support uses the CreateProcess API and this API will interpret command lines literally. However the redirect < needs special handling to actually perform redirection.
To get that behavior, you must use a layer of indirection. For example, you could run cmd.exe as the exe, and give it a command line that will make it interpret and run the command line mysql.exe --port= ... < "[INSTALLDIR]...". However, if you didn't already have a command prompt showing, this would cause one to show up. If you want to avoid that, you could write a custom wrapper that performs the redirection for you, either as a C++ DLL or, say, InstallScript action.
Alternately, if there is a parameter that tells mysql.exe to run a script from a file, you could pass that instead of using redirection. I wasn't able to find evidence of such a parameter in a quick web search.
Thanks for your comments Michael and I used cmd.exe /k AddStruct.bat to accomplish the task!

How to start a program from remote powershell console?

In the webgui for defaultapp, you can click a button to start the selected app in the drop down.
What command is hidden under that button to start the universal app? I would like to do this from a remote console programatically.
Also, is the source code available for the defaultapp/webgui?
You can use PowerShell to set an app as startup, run in headless mode etc.
Find the details of connecting it with PowerShell here: https://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
Also running in headless mode saves more memory, power, faster boot.
Also command line utils for enabling startup process:
https://ms-iot.github.io/content/en-US/win10/tools/CommandLineUtils.htm
-> Default App Sample: https://github.com/ms-iot/samples/tree/develop/IoTCoreDefaultApp
Let me know if you need anything else.

Execute a script located on Zabbix server on trigger

We are monitoring our production environments using Zabbix 2.4. New instances are provisioned with Ansible that sets up a Zabbix agent. What we need is for hosts to be removed from the server if they have been terminated so that we only receive messages about running instances becoming unavailable.
To do this I wrote a Python script that can take a zabbix host name as an argument, check if that host is on the list of running instances by calling awscli and delete the host if it's not on a "not terminated" list.
I put the script in /usr/bin/delete_host.py and configured an action to call for it when a "Agent not available" trigger is activated. This is how the Operation tab looks like link
And here is the Action Log link
I've tried a couple of ways to write the command, also placed the script in ExternalScripts directory. Turned on debug logs for the server but nothing in it mentioned an error or anything. In fact it only showed messages that command is being executed and everything is ok, but the host is still there. When I copy the command from Action Log and execute it manually everything works fine.
At this point I am really out of options on how to troubleshoot this further. I disabled selinux and added zabbix user to sudoers file with nopasswd. I can't find anything in any logs. Is it even possible to execute non-messaging scripts with zabbix?
Try to write the script in a way that will print "OK" or 0 if it ran properly and the error message or error code if it fails. Run the script using an active zabbix agent item on the Zabbix server host (use the function system.run). In this way you'll be able to create a trigger that will raise an error if the script fails to run.
You can also just schedule it using a different tool such as Rundeck.
The script does not have to be in the ExternalScripts directory, that is only required for items of type "external check". The operation screenshot you linked to uses relative path of delete_host.py, and that is almost guaranteed not to work. Your action log screenshot shows a few entries with /usr/bin/ prefixed, which is better.
At least for testing, make sure to specify full path to everything, including the python binary, for example /full/path/to/python /full/path/to/delete_host.py.
You also had a few entries that redirected all output to a file in /tmp/, but you didn't mention what got logged in there. Please use that approach and check the potential error messages as well.
Remote commands from "Actions" are run using the key system.run[command,nowait]. This "nowait" key returns 1 irrespective of the command result.
Try running system.run with "wait" parameter and see what the actual error is under "Latest data".
For me the error was "sudo: sorry, you must have a tty to run sudo" even i had "Defaults:zabbix !requiretty" in the sudoers file. I commented out the "#Defaults requiretty" line in /etc/sudoers file and it worked.

Unable to connect to https://myserver/VaultService

I have just installed Vault on my machine, I intend touse it single user.
When trying to use it for the first time, I get the error message below.
Is there anything I should enable?
I have the correct passwords.
I am using the Admin account.
I have Windows * 64 bits, Vault is also 64 bits.
Thanks to Beth's answer below, now I can at least visualise the following page, but still not be able to follow the links in it.
This is the result I get when I click on the links(Picture below).
Error messages are below, but the formatting is not good.
Most likely causes: The request matched a wildcard mime map.
The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.
Things you can try: If you want to serve this content as a static file, add an explicit MIME map.
Detailed Error Information: Module StaticFileModule Notification ExecuteRequestHandler Handler StaticFile Error Code 0x80070032
Requested URL http://vrindavana:80/VaultService/Admin/default.aspx Physical Path C:\inetpub\wwwroot\VaultService\Admin\default.aspx
Logon Method Anonymous
Logon User Anonymous
IIS:
I have IIS installed and if I browse it I see what's on the picture below.
First try reaching the Vault server using a browser. Try the URL http://<your Vault server name>/vaultservice/index.html. If you can not reach that page, then change to either the FQDN or the IP address.
If you still cannot reach the index.html page, then try reaching it using a browser right on the server and use localhost. The URL would then be http://localhost/vaultservice/index.html.
Let me know the results of these URLs first and then I'll give you next steps.
Beth
SourceGear Technical Support
Thanks for the update.
The error seems to indicate a problem with the .NET Framework. Here are the next steps you should try.
1) Register the .NET framework with IIS. Run a command-prompt as administrator and then change directories until you get to the highest version of the 4.x .NET framework. It might look something like cd C:\Windows\Microsoft.net\framework64\v4.0.30319, but I'm not sure of the entire path on your machine. Then run the command aspnet_regiis -i.
Then try your web page again.
2) If you then get a 404.2 error, then open your IIS Manager, click on the machine name and then click on ISAPI and CGI restrictions. Make sure the .NET frameworks are set to Allow there.