Skip to content

Check if file present #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

oscar123mendoza
Copy link

This is good for people who want to make sure a file is there and alert if the file is no there. For my case this is good for Nginx matchers. We have several matchers for our micro services and we want to loop through them to confirm they are there.

Pull Request Checklist

Is this in reference to an existing issue?
Nope.

General

  • Update Changelog following the conventions laid out on Keep A Changelog

  • Update README with any necessary configuration snippets

  • Binstubs are created if needed

  • RuboCop passes

  • Existing tests pass

New Plugins

  • Tests

  • Add the plugin to the README

  • Does it have a complete header as outlined here

Purpose

Known Compatablity Issues

This is good for people who want to make sure a file is there and alert if the file is no there. For my case this is good for Nginx matchers. We have several matchers for our micro services and we want to loop through them to confirm they are there.
@oscar123mendoza oscar123mendoza deleted the patch-2 branch August 16, 2019 19:34
@oscar123mendoza oscar123mendoza restored the patch-2 branch August 16, 2019 19:35
Copy link
Member

@majormoses majormoses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this a bit over slack and I gave some suggestions/pointers.

@oscar123mendoza
Copy link
Author

$ /opt/sensu/embedded/bin/check-file-exists.rb -c "/etc/sensu/conf.d/checks/psql-pointer-process-check.json"
CheckFileExists CRITICAL: 1 matching file(s) found: /etc/sensu/conf.d/checks/psql-pointer-process-check.json

$ /opt/sensu/embedded/bin/check-file-exists.rb -w "/etc/sensu/conf.d/checks/psql-pointer-process-check.json"
CheckFileExists WARNING: 1 matching file(s) found: /etc/sensu/conf.d/checks/psql-pointer-process-check.json

$ /opt/sensu/embedded/bin/check-file-exists.rb -u "/etc/sensu/conf.d/checks/psql-pointer-process-check.json"
CheckFileExists UNKNOWN: 1 matching file(s) found: /etc/sensu/conf.d/checks/psql-pointer-process-check.json

$ /opt/sensu/embedded/bin/check-file-exists.rb -p "/etc/sensu/conf.d/checks/psql-pointer-process-check.json"     
CheckFileExists OK: Matching file(s) found: /etc/sensu/conf.d/checks/psql-pointer-process-check.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants