So the maintenance and backup is done using an addon for elasticsearch called curator, which is written in python. The command that it runs (or would run on your system based on your configs) to close indexes is as follows:
su - nagios -c "curator close --older-than 5"
Traceback (most recent call last):
File "/usr/bin/curator", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
working_set.require(__requires__)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: elasticsearch>=1.0.0,<2.0.0
Well we know what the problem is now. Interesting issue though - we install curator 1.2.2 ... and it should not have issues with the installed version of Elasticsearch. I have a few more things to run that might be able to help us pinpoint why it's not working.
A possible fix would be to ensure that the installed elasticsearch python module and the curator module are at the correct versions. You can reinstall the curator module by running these 3 commands in order:
curator -v
Traceback (most recent call last):
File "/usr/bin/curator", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
working_set.require(__requires__)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: elasticsearch>=1.0.0,<2.0.0
su nagios -c "python /usr/lib/python2.6/site-packages/curator/curator.py close --older-than 5"
2014-12-15 17:03:43,644 INFO Job starting...
2014-12-15 17:03:43,648 INFO Beginning CLOSE operations...
2014-12-15 17:03:43,653 INFO Attempting to close index logstash-2014.12.02.
2014-12-15 17:03:43,658 INFO Skipping index logstash-2014.12.02: Already closed.
2014-12-15 17:03:43,658 INFO Attempting to close index logstash-2014.12.03.
2014-12-15 17:03:43,662 INFO Skipping index logstash-2014.12.03: Already closed.
2014-12-15 17:03:43,662 INFO Attempting to close index logstash-2014.12.04.
2014-12-15 17:03:43,666 INFO Skipping index logstash-2014.12.04: Already closed.
2014-12-15 17:03:43,666 INFO Attempting to close index logstash-2014.12.05.
2014-12-15 17:03:43,671 INFO Skipping index logstash-2014.12.05: Already closed.
2014-12-15 17:03:43,671 INFO Attempting to close index logstash-2014.12.06.
2014-12-15 17:03:43,677 INFO Skipping index logstash-2014.12.06: Already closed.
2014-12-15 17:03:43,677 INFO Attempting to close index logstash-2014.12.07.
2014-12-15 17:03:43,681 INFO Skipping index logstash-2014.12.07: Already closed.
2014-12-15 17:03:43,681 INFO Attempting to close index logstash-2014.12.08.
2014-12-15 17:03:43,685 INFO Skipping index logstash-2014.12.08: Already closed.
2014-12-15 17:03:43,685 INFO Attempting to close index logstash-2014.12.09.
2014-12-15 17:03:43,690 INFO Skipping index logstash-2014.12.09: Already closed.
2014-12-15 17:03:43,690 INFO Attempting to close index logstash-2014.12.10.
2014-12-15 17:03:43,695 INFO Skipping index logstash-2014.12.10: Already closed.
2014-12-15 17:03:43,696 INFO logstash-2014.12.11 is within the threshold period (5 days).
2014-12-15 17:03:43,696 INFO logstash-2014.12.12 is within the threshold period (5 days).
2014-12-15 17:03:43,696 INFO logstash-2014.12.13 is within the threshold period (5 days).
2014-12-15 17:03:43,696 INFO logstash-2014.12.14 is within the threshold period (5 days).
2014-12-15 17:03:43,696 INFO logstash-2014.12.15 is within the threshold period (5 days).
2014-12-15 17:03:43,696 INFO CLOSE index operations completed.
2014-12-15 17:03:43,696 INFO Done in 0:00:00.061628.
Are there multiple versions of python on here? Is it possible the regular command is running in a different version of python that is causing the issue? Because our script runs exactly the command I gave you before. If it needs the full path on your system to run correctly then that is why the maintenance is not actually doing what it is supposed to. It's throwing that distribution not found error.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.