Skip to content

stephengeller/nagios-check-tutorial

Repository files navigation

Nagios Check Tutorial

Created as part of an 'intro to Nagios checks' class.

How to use:

First, you'll need to set up the local server that our check will be querying:

$ git clone [email protected]:stephengeller/nagios-check-tutorial.git
$ cd nagios-check-tutorial
$ npm install # installs dependencies
$ npm start # starts the ndoe server
$ npm run json-only # starts a json-only server, serving the json-server.json file

How to query localhost server:

Find local ip:

  • run ifconfig | grep -A 5 en0
  • Copy the number after inet (possibly 10.10.x.x)
  • Then run curl against that ip instead of localhost, eg curl 10.10.10.140:3000/users

Once the server is up, you can run either the python (check_all_users_are_employed.py) or shell (check_all_users_are_employed.sh) script with an argument to verify whether users in our fake company are actually employed to the company or not.

$ ./check_all_users_are_employed.sh users
$ echo $? # This will show you whether the check passes or failed based on the exit code

The currently configured endpoints are:

  • users
  • users/passing
  • users/failing

About

Created to help teach basic check fundamentals

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published