Commit Graph

22 Commits

Author SHA1 Message Date
Ryan Beisner 8cc2df51aa
Standardize auxiliary file location across os-charms
Change-Id: I644db5de7a5dc1f41d13f2aa13cc1fa5c00c8b83
Closes-Bug: #1843826
2019-09-12 15:50:58 -05:00
Chris MacNaughton cdef3f6885 Do not accidentaly overwrite DATA_FILE
the ollect_rabbitmq_stats.sh file correctly
creates and uses a tempfile, except it writes
the colums headers to DATA_FILE, which is both
non-atomic and overwritten a few lines later with a mv.

Change-Id: I59a9279e67da26b483a0cac539abc8e40da3622b
Closes-Bug: #1806635
2018-12-04 12:06:03 +01:00
Alex Kavanagh 065914d696 Fix more PY3 issues in check_rabbitmq_queues.py
Note that, for PY3, the unbuffered IO in the check_rabbitmq.py script
has to be switched off as PY3 doesn't support unbuffered IO for text
(think str) rather than binary byte streams.

Change-Id: I79af54cdbd7381f88732b24f65e94451350b9ab9
Closes-Bug: #1804349
Closes-Bug: #1804348
2018-11-21 15:18:01 +00:00
Alex Kavanagh f30b4ac0c6 Fix incorrect syntax in scripts/check_rabbitmq.py
* This fixes the incorrect syntax in the scripts/check_rabbitmq.py
  file.  Unfortunately, there are no tests for these files.  To
  help with QA, added the 'scripts' directory to the pep8 test to
  validate that they are correct python syntax for future changes.

* Updated .gitigore to exclude __pycache__ directories for py3 and
  removed the __pycache__ directory files from the repo.

Change-Id: I406a70c3d04eb730e1c59189a83cc57495186105
Closes-Bug: #1804126
2018-11-20 08:38:51 +00:00
Alex Kavanagh 79a1ea26d6 Change charm to py3
The tests are still py2; they'll need an update to zaza at some point.

Change-Id: I2c4b1ba0212f96cf4a725c80d87b8b2bfed2186f
2018-10-24 14:50:35 +01:00
James Page 43dc1d47a3 nrpe: drop use of plurals for alert levels
Drop 'S' from CRITICALS AND WARNINGS to avoid any furture breakage.

Change-Id: I3f4f2371135fcf5d49427259b8cb37fc71f78d25
Closes-Bug: 1795944
2018-10-18 11:24:11 +01:00
Zuul fd3e48f96c Merge "Extend check_rabbitmq.py to honor ssl=only" 2018-05-15 10:53:35 +00:00
Felipe Reyes 6ede4d38b3 Extend check_rabbitmq.py to honor ssl=only
This patch enables checks of rabbitmq when SSL is enabled, when ssl
config option is set to 'on' both ports (5672 and 5671) will be
checked.

Change-Id: Ia0bab1dca65112cd06ae382f6ebc1cc280d7b130
Closes-Bug: 1687916
2018-03-09 20:42:02 -03:00
James Hebden c0b936c739 Add Nagios check for cluster partitions
This commit introduces the check_rabbitmq_cluster.py Nagios check, which
uses the HTTP management API to check for the presence of cluster
partitions. The check will only be installed if the management_plugin
charm configuration is set to True, enabling the HTTP API plugin.

The previous request to use administrator privileges to monitor cluster
health is no longer required. The create_user and user_exists logic has
been reworked to accomodate different tags, and the monitoring tag,
which is respected by the HTTP management API used to monitor cluster
health, has been used instead of the administrator privilege.

Also cleans up usage of os.getenv('CHARM_DIR') in several places in the
file hooks/rabbitmq_server_relations.py

Change-Id: Ib7eb1afe258931cc917c151a2b6d72dc56d30c95
Closes-Bug: #1548679
2018-02-21 10:30:34 +11:00
Liam Young 0024aefd13 Fix perms on queue_stats
collect_rabbitmq_stats.sh creates
/var/lib/rabbitmq/data/{}_queue_stats.dat with 600 perms which
cannot be read by the monitoring user. This bug was introduced by
a8f7dea1 which uses mktemp which creates the file with restricted
permissions.

Change-Id: Idf3022bf925dd02b4bb6c979980ec1c6211b6923
Closes-Bug: #1730604
2018-01-02 13:44:48 +00:00
Liam Young a8f7dea190 Write stats to tmp file before updating data file
This change updates the stats collection script so it writes to a
temporary file before updating the main stats file to ensure that
the update is an atomic operation.

Change-Id: I68d4e3e723ed62fb5e90ba6bcf284c432ba9cd6b
Closes-Bug: #1569143
2017-10-02 11:00:14 +00:00
Christopher Glass 660073888f Changed the Nagios status when the queue data is not available from CRIT to UNKNOWN. 2015-12-02 08:38:33 +01:00
Ryan Beisner 302729399d fix wily rmq+nrpe lockfile issue bug 1508537 2015-10-21 16:21:46 +00:00
Ryan Beisner f02ec65c44 remove a cat 2015-08-27 01:44:56 +00:00
Ryan Beisner f20110d720 update collect_rabbitmq_stats script to support Vivid 2015-08-27 00:32:28 +00:00
Jacek Nykis 21bc24944e Added stats cronjob and queue monitoring nagios plugin 2014-05-07 10:52:24 +01:00
David Ames b9e621b3e2 Use /usr/local/lib/nagios/plugins for non-packaged checks 2013-11-21 14:42:56 -08:00
David Ames a83043b686 Enable nrpe-external-master-relation. Use charmhelpers (embedded for now) 2013-11-15 11:15:16 -08:00
Adam Gandelman 30fa455444 Sync scripts/. 2013-04-09 18:22:26 -07:00
Jerry Seutter aa10f04b84 Removing rabbitmq service check because it only runs on the master. 2013-04-02 12:35:16 -06:00
Jerry Seutter b786a5f468 Health check fixes
- Don't monitor port 5671 as it is only on master
- Use /etc/init.d script rather than service command, which is borken.
2013-04-02 10:04:48 -06:00
Jerry Seutter f027dbca29 Added health check scripts to rabbitmq charm. 2013-04-01 13:47:19 -06:00