Giter Club home page Giter Club logo

Comments (3)

Napsty avatar Napsty commented on June 15, 2024

Proposition: Change the regex in the source code that the user should decide which regular expression to use:

Source Code:

# glob all devices - try '?' first
@dev =glob($opt_g);

Run plugin on FreeBSD:

/usr/local/libexec/nagios/check_smart.pl -g "/dev/da[0-9]" -i scsi
OK: [/dev/da0] - Device is clean --- [/dev/da1] - Device is clean --- [/dev/da2] - Device is clean --- [/dev/da3] - Device is clean --- [/dev/da4] - Device is clean --- [/dev/da5] - Device is clean --- [/dev/da6] - Device is clean --- [/dev/da7] - Device is clean|

Run plugin on Linux:

/usr/lib/nagios/plugins/check_smart -g "/dev/sd[a-z]" -i ata
OK: [/dev/sda] - Device is clean --- [/dev/sdb] - Device is clean|

This way the plugin is open for several OS and hard drive names and there is no fixed regex in the source code.

Other solutions welcome!

from check_smart.

Napsty avatar Napsty commented on June 15, 2024

This would probably also resolve issue #7 as the regular expression given by the end user can also contain exclusions if the regex is well done.

from check_smart.

Napsty avatar Napsty commented on June 15, 2024

As there was no comment/feedback/complaint/argument about this change, I went on and committed 80a87ac .

from check_smart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.