Skip to content

Environment Variables

Oliver Gorwits edited this page Jul 12, 2023 · 17 revisions

File Locations

NETDISCO_HOME

Default: $ENV{HOME} for the current user.

The location of Netdisco (in perl5), the MIBs (in netdisco-mibs), configuration (in environments), and log files (in logs).

NETDISCO_INC

Default: none.

Colon-separated list of additional library paths for the application (both web frontend and backend poller daemon), where plugins can be loaded. You might instead consider enabling the site_local_files configuration setting.


General Configuration

These variables override any configuration in your deployment.yml.

For the “NETDISCO_DB_…​” database variables, a stub "database" setting is still required, for example:

database: {}

NETDISCO_DB_NAME

Default (for docker images only): "netdisco"

Name of the database to connect to in PostgreSQL.

NETDISCO_DB_USER

Default (for docker images only): "netdisco"

The database connection user (or role).

NETDISCO_DB_PASS

Default (for docker images only): "netdisco"

The database connection password.

NETDISCO_DB_HOST

Name or IP of the server hosting PostgreSQL.

NETDISCO_DB_PORT

Default: 5432

TCP port on which PostgreSQL is listening.

NETDISCO_DB_TENANT

Default: netdisco

Use one of your named tenant databases for netdisco-{do,deploy,db-deploy}. So, in a way, this is shorthand for the above five options if you’ve configured the tenant_databases setting.

NETDISCO_RO_COMMUNITY

Default (only when device_auth is unset): "public"

Comma-separated list of SNMP v1/v2 read-only community strings.

NETDISCO_RW_COMMUNITY

Default (only when device_auth is unset): "private"

Comma-separated list of SNMP v1/v2 read-write community strings.

NETDISCO_ADMIN_USER

Default (for docker images only): "guest"

Web user configured for unauthenticated access.

NETDISCO_DOMAIN

Default (for docker images only): "discover"

DNS domain name (same as domain_suffix configuration). Additionally accepts discover as an instruction for Netdisco to try to work out the DNS domain.

NETDISCO_SNMP_BULKWALK_OFF

Default: unset

Set this to a true value to disable SNMP Bulkwalk feature. Overrides (and the same as) Netdisco’s bulkwalk_off setting.

PORT

Default: unset

TCP port number to listen on, which has the same effect as using --port at the command line.

This is only used by netdisco-web script and is implemented to support Heroku deployments.

IPV

Default: unset

IP protocol netdisco-web will listen on. From Net::Server


Debug Helpers

DBIC_TRACE

Default: false.

Logs SQL statements that are issued by the process (works for both web frontend and backend, in foreground or daemon mode, and netdisco-do CLI actions). Note that the SQL is not exactly what is sent to the database due to the pretty-print library used, so do not take it literally.

INFO_TRACE

Integer value. Default: 0.

Value is passed to both the Debug and DebugSNMP options of the SNMP::Info module. See the SNMP::Info documentation for more details.

SSH_TRACE

Bitmask expressed as an integer value. Default: 0.

Value is passed to the Debug option of the Net::OpenSSH module. See the Net::OpenSSH documentation for more details.

ND2_SHOW_COMMUNITY

Default: false.

Whether to show the SNMP v2 community string or v3 username and protocols in the debug-level log output of Netdisco.

ND2_LOG_PLUGINS

Default: false.

Whether to show loading of plugin modules and worker execution in the debug-level log output of Netdisco.

ND2_SINGLE_WORKER

Default: false.

Only run one backend worker process (the tasks setting), and no scheduler.

ND2_DB_ROLLBACK

Default: false.

Any changes to Netdisco’s database made during the running action will be rolled back. Note that this does not apply to changes to the job queue, which happen outside of worker actions.

Also works for the command-line netdisco-{deploy,db-deploy} scripts, with the exception of initial Schema installation in the database (the dbix_class_schema_versions table and first two versions).

Internal use

These environment variables are used in some places by netdisco internally and are not intended to be used in a normal deployment. They are listed here because setting or changing these can lead to strange behavior.

  • ANSI_COLORS_DISABLED

  • DANCER_APPDIR

  • DANCER_CONFDIR

  • DANCER_DEBUG

  • DANCER_ENVDIR

  • DANCER_ENVIRONMENT

  • DANCER_PUBLIC

  • DANCER_VIEWS

  • HARNESS_ACTIVE

  • HOME

  • NETDISCO_TEMP

  • ND_PHANTOMJS

  • PATH

  • PERLBREW_PERL

  • PERL_ANYEVENT_HOSTS

  • PERL_ANYEVENT_MAX_OUTSTANDING_DNS

  • PERL_LOCAL_LIB_ROOT

  • PGHOST

  • PGPORT

  • PGDATABASE

  • PGUSER

  • PGPASSWORD

  • PGCLIENTENCODING

  • PLACK_ENV

  • REMOTE_USER

  • SHOW_COMMUNITY

  • USER

Clone this wiki locally