updated URLs
c97294ee
Hari Sekhon
committed
1 changed file
.travis.yml
/.travis.yml+64
/.travis.yml
Add comment 1 Plus  #!/usr/bin/env python
Add comment 2 Plus  # vim:ts=4:sts=4:sw=4:et
Add comment 3 Plus  #
Add comment 4 Plus  # Author: Hari Sekhon
Add comment 5 Plus  # Date: 2017-11-01 20:02:20 +0100 (Wed, 01 Nov 2017)
Add comment 6 Plus  #
Add comment 7 Plus  # https://github.com/harisekhon/nagios-plugins
Add comment 8 Plus  #
Add comment 9 Plus  # License: see accompanying Hari Sekhon LICENSE file
Add comment 10 Plus  #
Add comment 11 Plus  # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback
Add comment 12 Plus  # to help improve or steer this or other code I publish
Add comment 13 Plus  #
Add comment 14 Plus  # http://www.linkedin.com/in/harisekhon
Add comment 15 Plus  #
Add comment 16 Plus  
Add comment 17 Plus  """
Add comment 18 Plus  
Add comment 19 Plus  Nagios Plugin to check an Alluxio Worker's last heartbeat to the Master
Add comment 20 Plus  
Add comment 21 Plus  Thresholds apply to the number of seconds since last heartbeat to master
Add comment 22 Plus  
Add comment 23 Plus  Under normal operation this usually shows 0 secs indicating a heartbeat was received in the last second
Add comment 24 Plus  
Add comment 25 Plus  Tested on Alluxio 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
Add comment 26 Plus  
Add comment 27 Plus  """
Add comment 28 Plus  
Add comment 29 Plus  from __future__ import absolute_import
Add comment 30 Plus  from __future__ import division
Add comment 31 Plus  from __future__ import print_function
Add comment 32 Plus  #from __future__ import unicode_literals
Add comment 33 Plus  
Add comment 34 Plus  import os
Add comment 35 Plus  import sys
Add comment 36 Plus  libdir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'pylib'))
Add comment 37 Plus  sys.path.append(libdir)
Add comment 38 Plus  try:
Add comment 39 Plus   # pylint: disable=wrong-import-position
Add comment 40 Plus   from check_tachyon_worker_heartbeat import CheckTachyonWorkerHeartbeat
Add comment 41 Plus  except ImportError as _:
Add comment 42 Plus   print('module import failed: %s' % _, file=sys.stderr)
Add comment 43 Plus   print("Did you remember to build the project by running 'make'?", file=sys.stderr)
Add comment 44 Plus   print("Alternatively perhaps you tried to copy this program out without it's adjacent libraries?", file=sys.stderr)
Add comment 45 Plus   sys.exit(4)
Add comment 46 Plus  
Add comment 47 Plus  __author__ = 'Hari Sekhon'
Add comment 48 Plus  __version__ = '0.2.0'
Add comment 49 Plus  
Add comment 50 Plus  
Add comment 51 Plus  class CheckAlluxioWorkerHeartbeat(CheckTachyonWorkerHeartbeat):
Add comment 52 Plus  
Add comment 53 Plus   def __init__(self):
Add comment 54 Plus   # Python 2.x
Add comment 55 Plus   super(CheckAlluxioWorkerHeartbeat, self).__init__()
Add comment 56 Plus   # Python 3.x
Add comment 57 Plus   # super().__init__()
Add comment 58 Plus   self.software = 'Alluxio'
Add comment 59 Plus   self.name = ['Alluxio Master', 'Alluxio']
Add comment 60 Plus  
Add comment 61 Plus  
Add comment 62 Plus  if __name__ == '__main__':
Add comment 63 Plus   CheckAlluxioWorkerHeartbeat().main()
Add comment 64 Plus