Getting Started with the Platform Installer

Hey @Trevor_Dearham,

In regards to the winsw template, I think those are reasonable requests; however, I know we’ve received feedback in the past to not be quite as aggressive about trying to stay running if something is wrong (i.e. it may not be an ideal default behavior). As I’m sure you already know, you can modify the template file (located in the ./bin directory of the NPI folder) to contain whatever configurations you’d like and they will propagate to each subsequent plugin you install. That said, I will look into mechanisms to help facilitate these sorts of configurations in a more user friendly way…potentially exposing them as ‘config’ options?

As far as being in a public repo goes, I think you’re absolutely right. We’ve started discussions internally to discuss the transition and identify any hard blocks (which we don’t anticipate there being any). I will respond here as that conversation unfolds.

Thanks for taking the time!

We place our install software on a central server and use UNC pathing. This install method does not work for us. It installs the plugin in the NPI directory rather than the default Windows application path and npi cannot use UNC paths. It does need to take in account previously install agents. The only benefits I can see in having the installer local is to handle software updates and uninstalls. Regarding the Windows service it should prompt for the userid/password of the id it should run under, this maybe more of a plugin issue.

These are great suggestions; I’ll enter them into our feature tracking tool.

Hey @brad_plumlee ,

As John mentioned, thank you for bringing the UNC issue to our attention. Having the ability to decouple the plugins directory from the NPI install path has been something we’ve known we’ve wanted to do for a while, and support for network paths is an important scenario for us to ensure we consider when we get a chance to light that feature up.

As far as detecting installed plugins, NPI will (does) do that; however, it cannot detect plugins that are not in the plugin directory (i.e. if you install it manually it will not be aware of it); however, it will not allow you to daemonize the plugin twice per box, so while you can install twice and run in the foreground twice, you should not be able to set it as a background service twice. We are aiming to improve that detection even further in future releases.

Finally, the feature for setting the user/pass is one that we actually did have and explicitly removed due to security concerns. The ability to start the service with a specific set of credentials would depend on us storing your domain credentials in a file on disk (or some other ‘less-secure than AD or SAM’ way); something that drastically would limit the security of your account. Instead, we recommend you start the service with NPI and use the built in ‘services’ dialog to manage the running credentials or one of the other Microsoft provided means of service management.

I hope this helps and please let me know if you have any further questions!



Note to Mac OS X users: look for “darwin” in the release folder for which script/package to download.

1 Like

I moved a post to a new topic: Security vs suggested NPI installation methods

Hey @adam how could I set this up and install automatically in a provisioning script?


You can use the manual steps to sequence out the NPI installation of a plugin into a provisioning script. See the NPI documentation for additional details. You would most likely need to write your config file manually via your provisioning script since the NPI tool will attempt to open the file in a text editor for the user to edit if needed for your configuration.

I’m fairly new to NR in general and to using the NPI tool specifically. I’m curious what user I should be performing the NPI install as? Would it be the newrelic user? Or is it meant to be per user on a system? Does the NPI tool require sudo privileges to install plugins or then execute them?

Hey @nccdevops,

Welcome to the NR family! You can use the NPI tool to download and configure a plugin under any user that you’d like (there are no special privileges unless required by the plugin itself – which I do not believe is the case for any currently ‘NPI-supported’ plugins). That said, the process of setting your plugin up to run as a daemon (and automatically restart when the machine reboots) does require sudo privileges to access the /etc/init.d directory and to run tools like chkconfig. You can use the ‘–user’ flag to configure who you’d like the plugin to run as though, so even though it will take sudo privlieges to install it can run as a de-escalated user.

Also, check out ‘npi --help’ or ’ npi command --help’ for more details and options!

Hope this helps, but certainly don’t hesitate to reach out if you have any other questions or concerns!

What I would like to be able to do is to install this into a directory which is listed in my $PATH (e.g., /usr/local/bin), and run npi from anywhere.

I’ve fixed this in my local copy, and would have submitted a pull-request, but I haven’t been able to find npi on your public GitHub, so I’ll post it here:

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
$DIR/bin/node $DIR/npi.js "$@"
1 Like

hey @rparman,

Thanks immensely for the contribution! The plan has been to make NPI open source for a while, but it unfortunately hasn’t gotten priority yet. The recommendation is a great one, and we went through several long conversations regarding this topic across the slew of expected users and supported operating systems. Since you’ve taken the time to provide this code, I’m going to take some time aside to investigate the topic of running NPI from the path again on our side, and hopefully this will make its way into the next release!

All the best,


Is NPI meant to be only used manually or is there a way to use it under configuration manager like Puppet?

NPI prepare opens text editor (unless spcified -n), but that’s no good under CM and I didn’t notice in the help any way of providing config file or parameters directly to it.

Hi There,

The expectation with NPI is that you would use it manually and not with a CM tool like Puppet. If you would like I would be more than happy to file a feature request on your behalf. If you would like me to do so, please don’t hesitate to let me know.




If you could file a feature request so one could give configuration file for NPI to use and put in place where it belongs, that would be super.

Hey @messis - I have submitted that request to our product managers. :slight_smile:

I moved a post to a new topic: Installing NPI

Hey, sorry for the delay.

Exactly - I have the config files available, but where do I move them to so I can avoid the interactive prompts while installing a new plugin? I have the newrelic.json and plugin.json files ready to go.

@timz - I’d recommend running npi with the -n option to skip the interactive text editor, then just put your prepared files into the expected location. That is going to be plugins/{plugin_guid}/{plugin_name_version}/config relative to your NPI installation location. I’d also recommend not starting the plugin until the config files are in place since otherwise you will need to restart the plugin to pick up the appropriate config files. As long as they are in place when the plugin is started, you should run into no issues using puppet or chef to install the plugins.