Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/griesbacher/check_azure
Nagios/Icinga like check to monitor Microsoft azure objects
https://github.com/griesbacher/check_azure
Last synced: about 1 month ago
JSON representation
Nagios/Icinga like check to monitor Microsoft azure objects
- Host: GitHub
- URL: https://github.com/griesbacher/check_azure
- Owner: Griesbacher
- License: agpl-3.0
- Created: 2016-11-23T15:10:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-23T16:17:18.000Z (about 8 years ago)
- Last Synced: 2024-06-20T00:36:04.358Z (6 months ago)
- Language: Go
- Size: 75.2 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# check_azure
Nagios/Icinga like check to monitor Microsoft azure objectsTo use this check you need some keys which are a little hidden if you are new to the subject:
- clientId
- clientSecret
- subscriptionId
- tenantIdThe first two are identifying your application. You have to register the app because it is using Microsoft OAuth service. Here is a short documentation: https://msdn.microsoft.com/de-de/library/bb676626.aspx
The third one is the key which identifies your azure abo. If your on the azure website it is basically everywhere, here is one place to find it: https://blogs.msdn.microsoft.com/mschray/2015/05/13/getting-your-azure-guid-subscription-id/
The last one also not too hard to find, here is one way to do it: http://merill.net/2015/01/how-to-get-the-azure-ad-tenant-id-without-powershell/At last you have to give your new registered application the right to read the data in azure, therefore add your application to your resourcegroup as reader this can be done in the accesscontrol.
Now the hard stuff is over ;)
Currently supported are
- Subscriptions
- Classic Virtual Machines- CPU
- Network
- Diskmore to come if Microsoft opens up... The REST API is very limited at the moment.
Be careful there is a direct context between subscriptionId -> resourceGroup -> name. You could have multiple subscriptionIds, where every id contains multiple groups with multiple objects.
```
go run check_azure.go --clientId XXX --clientSecret XXX --subscriptionId XXX --tenantId XXX mode s show
OK - see below
0: Microsoft Imagine
ID: XXX
SpendingLimit: On
1: Kostenlose Testversion
ID: XXX
SpendingLimit: Ongo run check_azure.go --clientId XXX --clientSecret XXX --subscriptionId XXX --tenantId XXX mode cvm cpu --resourceGroup test --name Ubuntu
OK - Percentage CPU last checked: 2016-11-23 09:15:00 +0100 CET|'Percentage CPU'=0.177125%;80;90;;go run check_azure.go --clientId XXX --clientSecret XXX --subscriptionId XXX --tenantId XXX mode cvm network --resourceGroup test --name Ubuntu
OK - Network|'Network In'=26125B;100000;200000;; 'Network Out'=16444B;100000;200000;;
Network In last checked: 2016-11-23 09:15:00 +0100 CET
Network Out last checked: 2016-11-23 09:15:00 +0100 CETgo run check_azure.go --clientId XXX --clientSecret XXX --subscriptionId XXX --tenantId XXX mode cvm disk --resourceGroup test --name Ubuntu
Critical - Disk|'Disk Read Bytes/sec'=0Bps;100;200;; 'Disk Write Bytes/sec'=887.562252Bps;100;200;;
Disk Read Bytes/sec last checked: 2016-11-23 09:15:00 +0100 CET
Disk Write Bytes/sec last checked: 2016-11-23 09:15:00 +0100 CET
```This page is very useful to search the API: https://resources.azure.com/