Celerium.Auvik
Buy me a coffee
Whether you use this project, have learned something from it, or just like it, please consider supporting it by buying me a coffee, so I can dedicate more time on open-source projects like this :)
About The Project
The Celerium.Auvik PowerShell wrapper offers users the ability to extract data from Auvik into third-party reporting tools and aims to abstract away the details of interacting with Auvik’s API endpoints in such a way that is consistent with PowerShell nomenclature. This gives system administrators and PowerShell developers a convenient and familiar way of using Auvik’s API to create documentation scripts, automation, and integrations.
- :book: Project documentation can be found on Github Pages
- :book: Auvik’s REST API documentation on their management portal here.
Auvik features a REST API that makes use of common HTTPs GET actions. In order to maintain PowerShell best practices, only approved verbs are used.
- GET -> Get-
- POST -> Clear-
Additionally, PowerShell’s verb-noun
nomenclature is respected. Each noun is prefixed with Auvik
in an attempt to prevent naming problems.
For example, one might access the /tenants
endpoint by running the following PowerShell command with the appropriate parameters:
Get-AuvikTenant
Install
This module can be installed directly from the PowerShell Gallery with the following command:
Install-Module -Name Celerium.Auvik
- :information_source: This module supports PowerShell 5.0+ and should work in PowerShell Core.
- :information_source: If you are running an older version of PowerShell, or if PowerShellGet is unavailable, you can manually download the main branch and place the latest version of Celerium.Auvik from the build folder into the (default)
C:\Program Files\WindowsPowerShell\Modules
folder.
Project documentation can be found on Github Pages
- A full list of functions can be retrieved by running
Get-Command -Module Celerium.Auvik
. - Help info and a list of parameters can be found by running
Get-Help <command name>
, such as:
Get-Help Get-AuvikTenant
Get-Help Get-AuvikTenant -Full
Initial Setup
After installing this module, you will need to configure both the base URI & API key that are used to talk with the Auvik API.
- Run
Add-AuvikBaseURI
- By default, Auvik’s
https://auvikapi.us1.my.auvik.com/v1
URI is used. - If you have your own API gateway or proxy, you may put in your own custom URI by specifying the
-BaseUri
parameter:Add-AuvikBaseURI -BaseUri http://myapi.gateway.celerium.org
- By default, Auvik’s
- Run
Add-AuvikAPIKey -Username 'celerium@celerium.org' -ApiKey 123456789
- It will prompt you to enter your API key if you do not specified.
- Auvik API keys are generated via the Auvik portal
- [optional] Run
Export-AuvikModuleSetting
- This will create a config file at
%UserProfile%\Celerium.Auvik
that holds the base uri & API key information. - Next time you run
Import-Module -Name Celerium.Auvik
, this configuration file will automatically be loaded. - :warning: Exporting module settings encrypts your API key in a format that can only be unencrypted by the user principal that encrypted the secret. It makes use of .NET DPAPI, which for Windows uses reversible encrypted tied to your user principal. This means that you cannot copy your configuration file to another computer or user account and expect it to work.
- :warning: However in Linux\Unix operating systems the secret keys are more obfuscated than encrypted so it is recommend to use a more secure & cross-platform storage method.
- This will create a config file at
Usage
Calling an API resource is as simple as running Get-Auvik<resourceName>
- The following is a table of supported functions and their corresponding API resources:
- Table entries with [
-
] indicate that the functionality is NOT supported by the Auvik API at this time.
Section | API Resource | Create | Read | Update | Delete |
---|---|---|---|---|---|
alert | /Alert/dismiss/{id} | - | Clear-AuvikAlert | - | |
alert | /Alert/history/info | - | Get-AuvikAlert | - | - |
alert | /Alert/history/info/{id} | - | Get-AuvikAlert | - | - |
billing | /billing/usage/client | - | Get-AuvikBilling | - | - |
billing | /billing/usage/device/{id} | - | Get-AuvikBilling | - | - |
clientManagement | /tenants | - | Get-AuvikTenant | - | - |
clientManagement | /tenants/detail | - | Get-AuvikTenant | - | - |
clientManagement | /tenants/detail/{id} | - | Get-AuvikTenant | - | - |
inventory | /inventory/component/info | - | Get-AuvikComponent | - | - |
inventory | /inventory/component/info/{id} | - | Get-AuvikComponent | - | - |
inventory | /inventory/configuration | - | Get-AuvikConfiguration | - | - |
inventory | /inventory/configuration/{id} | - | Get-AuvikConfiguration | - | - |
inventory | /inventory/device/detail | - | Get-AuvikDevice | - | - |
inventory | /inventory/device/detail/{id} | - | Get-AuvikDevice | - | - |
inventory | /inventory/device/detail/extended | - | Get-AuvikDevice | - | - |
inventory | /inventory/device/detail/extended/{id} | - | Get-AuvikDevice | - | - |
inventory | /inventory/device/info | - | Get-AuvikDevice | - | - |
inventory | /inventory/device/info/{id} | - | Get-AuvikDevice | - | - |
inventory | /inventory/device/lifecycle | - | Get-AuvikDeviceLifecycle | - | - |
inventory | /inventory/device/lifecycle/{id} | - | Get-AuvikDeviceLifecycle | - | - |
inventory | /inventory/device/warranty | - | Get-AuvikDeviceWarranty | - | - |
inventory | /inventory/device/warranty/{id} | - | Get-AuvikDeviceWarranty | - | - |
inventory | /inventory/entity/audit | - | Get-AuvikEntity | - | - |
inventory | /inventory/entity/audit/{id} | - | Get-AuvikEntity | - | - |
inventory | /inventory/entity/note | - | Get-AuvikEntity | - | - |
inventory | /inventory/entity/note/{id} | - | Get-AuvikEntity | - | - |
inventory | /inventory/interface/info | - | Get-AuvikInterface | - | - |
inventory | /inventory/interface/info/{id} | - | Get-AuvikInterface | - | - |
inventory | /inventory/network/detail | - | Get-AuvikNetwork | - | - |
inventory | /inventory/network/detail/{id} | - | Get-AuvikNetwork | - | - |
inventory | /inventory/network/info | - | Get-AuvikNetwork | - | - |
inventory | /inventory/network/info/{id} | - | Get-AuvikNetwork | - | - |
other | /authentication/verify | - | Get-AuvikCredential | - | - |
pollers | /settings/snmppoller/{snmpPollerSettingId}/devices | - | Get-AuvikSNMPPollerDevice | - | - |
pollers | /settings/snmppoller | - | Get-AuvikSNMPPollerSetting | - | - |
pollers | /settings/snmppoller/{snmpPollerSettingId} | - | Get-AuvikSNMPPollerSetting | - | - |
pollers | /stat/snmppoller/int | - | Get-AuvikSNMPPollerHistory | - | - |
pollers | /stat/snmppoller/string | - | Get-AuvikSNMPPollerHistory | - | - |
statistics | /stat/component/{componentType}/{statId} | - | Get-AuvikComponentStatistics | - | - |
statistics | /stat/deviceAvailability/{statId} | - | Get-AuvikDeviceAvailabilityStatistics | - | - |
statistics | /stat/device/{statId} | - | Get-AuvikDeviceStatistics | - | - |
statistics | /stat/interface/{statId} | - | Get-AuvikInterfaceStatistics | - | - |
statistics | /stat/oid/{statId} | - | Get-AuvikOIDStatistics | - | - |
statistics | /stat/service/{statId} | - | Get-AuvikServiceStatistics | - | - |
asm | /asm/app/info | - | Get-AuvikASMApplication | - | - |
asm | /asm/client/info | - | Get-AuvikASMClient | - | - |
asm | /asm/securityLog/info | - | Get-AuvikASMSecurityLog | - | - |
asm | /asm/tag/info | - | Get-AuvikASMTag | - | - |
asm | /asm/user/info | - | Get-AuvikASMUser | - | - |
Each Get-Auvik*
function will respond with the raw data that Auvik’s API provides.
- :warning: Returned data is mostly structured the same but can vary between commands.
- data - The actual information requested (this is what most people care about)
- links - Information about the number of pages of results are available and other metadata.
- meta - Information about the number of pages of results are available and other metadata.
Roadmap
- Add Changelog
- Build more robust Pester & ScriptAnalyzer tests
- Figure out how to do CI & PowerShell gallery automation
- Add example scripts & automation
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag “enhancement”. Don’t forget to give the project a star! Thanks again!
See the CONTRIBUTING guide for more information about contributing.
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Acknowledgments
Big thank you to the following people and services as they have provided me with lots of helpful information as I continue this project!