InfluxDB - A distributed time series database
Module to provide InfluxDB compatibility to Salt (compatible with InfluxDB version 0.5-0.8)
New in version 2014.7.0.
influxdb Python module (>= 1.0.0)
This module accepts connection configuration details either as parameters or as configuration settings in /etc/salt/minion on the relevant minions:
influxdb08.host: 'localhost'
influxdb08.port: 8086
influxdb08.user: 'root'
influxdb08.password: 'root'
This data can also be passed into pillar. Options passed into opts will overwrite options passed into pillar.
Create a database
Database name to create
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.db_create <name>
salt '*' influxdb08.db_create <name> <user> <password> <host> <port>
Checks if a database exists in Influxdb
Database name to create
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.db_exists <name>
salt '*' influxdb08.db_exists <name> <user> <password> <host> <port>
List all InfluxDB databases
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.db_list
salt '*' influxdb08.db_list <user> <password> <host> <port>
Remove a database
Database name to remove
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.db_remove <name>
salt '*' influxdb08.db_remove <name> <user> <password> <host> <port>
Checks if a credential pair can log in at all.
If a database is specified: it will check for database user existence. If a database is not specified: it will check for cluster admin existence.
The user to connect as
The password of the user
The database to try to log in to
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.login_test <name>
salt '*' influxdb08.login_test <name> <database>
salt '*' influxdb08.login_test <name> <database> <user> <password> <host> <port>
Querying data
The database to query
Query to be executed
Time precision to use ('s', 'm', or 'u')
Whether is chunked or not
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.query <database> <query>
salt '*' influxdb08.query <database> <query> <time_precision> <chunked> <user> <password> <host> <port>
Add a retention policy.
The database to operate on.
Name of the policy to modify.
How long InfluxDB keeps the data.
How many copies of the data are stored in the cluster.
Whether this policy should be the default or not. Default is False.
CLI Example:
salt '*' influxdb.retention_policy_add metrics default 1d 1
Modify an existing retention policy.
The database to operate on.
Name of the policy to modify.
How long InfluxDB keeps the data.
How many copies of the data are stored in the cluster.
Whether this policy should be the default or not. Default is False.
CLI Example:
salt '*' influxdb08.retention_policy_modify metrics default 1d 1
Check if a retention policy exists.
The database to operate on.
Name of the policy to modify.
CLI Example:
salt '*' influxdb08.retention_policy_exists metrics default
Get an existing retention policy.
The database to operate on.
Name of the policy to modify.
CLI Example:
salt '*' influxdb08.retention_policy_get metrics default
Change password for a cluster admin or a database user.
If a database is specified: it will update database user password. If a database is not specified: it will update cluster admin password.
User name for whom to change the password
New password
The database on which to operate
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.user_chpass <name> <passwd>
salt '*' influxdb08.user_chpass <name> <passwd> <database>
salt '*' influxdb08.user_chpass <name> <passwd> <database> <user> <password> <host> <port>
Create a cluster admin or a database user.
If a database is specified: it will create database user. If a database is not specified: it will create a cluster admin.
User name for the new user to create
Password for the new user to create
The database to create the user in
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.user_create <name> <passwd>
salt '*' influxdb08.user_create <name> <passwd> <database>
salt '*' influxdb08.user_create <name> <passwd> <database> <user> <password> <host> <port>
Checks if a cluster admin or database user exists.
If a database is specified: it will check for database user existence. If a database is not specified: it will check for cluster admin existence.
User name
The database to check for the user to exist
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.user_exists <name>
salt '*' influxdb08.user_exists <name> <database>
salt '*' influxdb08.user_exists <name> <database> <user> <password> <host> <port>
List cluster admins or database users.
If a database is specified: it will return database users list. If a database is not specified: it will return cluster admins list.
The database to list the users from
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.user_list
salt '*' influxdb08.user_list <database>
salt '*' influxdb08.user_list <database> <user> <password> <host> <port>
Remove a cluster admin or a database user.
If a database is specified: it will remove the database user. If a database is not specified: it will remove the cluster admin.
User name to remove
The database to remove the user from
User name for the new user to delete
The user to connect as
The password of the user
The host to connect to
The port to connect to
CLI Example:
salt '*' influxdb08.user_remove <name>
salt '*' influxdb08.user_remove <name> <database>
salt '*' influxdb08.user_remove <name> <database> <user> <password> <host> <port>