Sha256: 18b4d75d8a132d561f8ae9498f5a639dac60859721a0b3a776842789ebbc0006

Contents?: true

Size: 1.36 KB

Versions: 5

Compression:

Stored size: 1.36 KB

Contents

Feature: Plugin Output

	In order to comply with official nagios plugin development guidelines
	As a sysadmin building my own nagios plugins
	I want to return a nagios compatible plugin output

	Scenario Outline: CRITICAL, WARNING and OK
		When I run a plugin with the following methods:
			"""
	    def critical?;	<crit>	end
	    def warning?;		<warn>	end
			"""
		Then the exit status should be <code>
		And the plugin should print "<status>"
		
		Examples:
		 | crit  | warn  | code | status   |
		 | true  | true  | 2    | CRITICAL |
		 | true  | false | 2    | CRITICAL |
		 | false | true  | 1    | WARNING  |
		 | false | false | 0    | OK       |

	Scenario Outline: UNKNOWN when all status checks return false
		When I run a plugin with the following methods:
			"""
  		def critical?;	false		end
  		def warning?;		false		end
			def ok?;				<ok>		end
			"""
		Then the exit status should be <code>
		And the plugin should print "<status>"
		
		Examples:
		 | ok    | code | status                                     |
		 | true  | 0    | OK                                         |
		 | false | 3    | UNKNOWN: All status checks returned false! |

	Scenario: UNKNOWN when an exception was raised
		When I run a plugin with the following methods:
			"""
			def critical?
				raise "OOPS!"
			end
			"""
		Then the exit status should be 3
		And the plugin should print "UNKNOWN: OOPS!"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nagiosplugin-0.0.7 features/plugin_output.feature
nagiosplugin-0.0.6 features/plugin_output.feature
nagiosplugin-0.0.5 features/plugin_output.feature
nagiosplugin-0.0.4 features/plugin_output.feature
nagiosplugin-0.0.3 features/plugin_output.feature