This repository has been archived by the owner on Feb 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathREADME
151 lines (104 loc) · 4.42 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Windows Azure Monitor
=====================
Introduction
------------
Windows Azure Monitor includes utilities to monitor different aspects of Windows
Azure. These utilities are designed to be used with Nagios and Zabbix, but could
also be used in other creative ways.
License
-------
Apache License, Version 2.0
See COPYING
Installation
------------
Two ways to install:
1. Download and extract the source package. Run 'python setup.py install' See
http://docs.python.org/2.7/install/index.html for additional information
2. Install using pip, 'pip install azuremonitor' Some distributions call pip
pip-python.
Dependencies
------------
* Python 2.6 or 2.7
* azure - Window Azure sdk for Python
* argparse - For Python 2.6
* OpenSSL - pyOpenSSL
* pyodbc - Connect to SQL Azure
* FreeTDS - Used by ODBC to connect to SQL Azure
Setup
-----
Nagios
______
1. Create symlinks from your Nagios plugin directory to the Azure monitor utilities.
Example::
ln -s /usr/bin/check_azure_compute.py /usr/lib64/nagios/plugins
ln -s /usr/bin/check_azure_ad.py /usr/lib64/nagios/plugins
ln -s /usr/bin/check_azure_sql.py /usr/lib64/nagios/plugins
ln -s /usr/bin/check_azure_storage.py /usr/lib64/nagios/plugins
ln -s /usr/bin/check_azure_paas.py /usr/lib64/nagios/plugins
2. Download your .publishsettings file for your Azure account. Something like:
https://windows.azure.com/download/publishprofile.aspx
3. Move your .publishsetttings file to a safe place and protect it. Example::
mv azure.publishsettings /etc/nagios/private
chmod 640 /etc/nagios/private/azure.publishsettings
chown root:nagios /etc/nagios/private/azure.publishsettings
Here only root and the nagios group, which nagios runs under, is allowed to
read the file
4. Optionally set a variable in your resource.cfg (usually /etc/nagios/private/resource.cfg)
To point to your publishsettings file
5. Setup a command in a config file as usual for nagios::
define command{
command_name check_azure_compute
command_line $USER1$/check_azure_compute.py $HOSTADDRESS$ -p $PSFILE$
}
define command{
command_name check_azure_sql
command_line $USER1$/check_azure_sql.py $HOSTADDRESS$ $ARG1$
}
define command{
command_name check_azure_ad
command_line $USER1$/check_azure_ad.py $HOSTADDRESS$ $ARG1$
}
define command{
command_name check_azure_paas
command_line $USER1$/check_azure_paas.py $HOSTADDRESS$ $ARG1$
}
define command{
command_name check_azure_storage
command_line $USER1$/check_azure_storage.py $HOSTADDRESS$ $ARG1$
}
6. In the service file setup appropriate parameters. Examples::
check_command check_azure_sql!-d azuredb -u username -p pwd -k dbsize -vv!
check_command check_azure_ad!-c clientid -s secret -k listusers -vv!
check_command check_azure_paas!-p psfile -s storageact -k availmemory -w 3000: -c 2000: -vv!
check_command check_azure_storage!-p psfile --table --tx -k percentsuccess -w 99: -c 95:!
Zabbix
______
1. Use these utilities as an external check: https://www.zabbix.com/documentation/1.8/manual/config/items#external_checks
2. You may need to increase the timeout for external check in yor zabbix_server.conf::
Timeout=10
3. Also in zabbix_server.conf, uncomment the ExternalScripts location, if commented::
ExternalScripts=/etc/zabbix/externalscripts
4. Link the utilities to that location. Example::
ln -s /usr/bin/check_azure_compute.py /etc/zabbix/externalscripts
5. Download your .publishsettings file for your Azure account. Something like:
https://windows.azure.com/download/publishprofile.aspx
6. Move you .publishsetttings file to a safe place and protect it. Example::
mv azure.publishsettings /etc/zabbix
chmod 640 /etc/zabbix/azure.publishsettings
chown root:zabbix /etc/zabbix/azure.publishsettings
Here only root and the zabbix group, which zabbix runs under, is allowed to
read the file
7. Use the zabbix interface to setup the external check. Example::
Item
External check
Key: check_azure_compute.py[-p /etc/zabbix/azure.publishsettings]
Type: Character
8. Use the zabbix interface to setup the trigger. Example::
Trigger
Expression:
{<host/template>:check_azure_compute.py[-p /etc/zabbix/azure.publishsettings].str(All cool)}=0
Changelog
---------
0.1
___
Initial Release.