Results 1 to 7 of 7

Thread: Learn to create new plugins

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    4

    Learn to create new plugins

    Hi All,

    I've been googling around the last few days trying to find good material on learning how to write new plugins for Shinken/Nagios/Whatever. I confess I am a little stuck though as everything I come across just seems to dump a whole script on you rather than walk you through how to actually create one, what is required, how to fetch variables (like the hostname or auth credentials from the hosts config file), etc.

    The reason I want to create one is that the company I work for produces a network camera that doesn't have SNMP but does provide loads of information via various HTTP API calls that I would like to pull back to Shinken and then filter down to useful things (like storage faults) and the like. I don't want to make it super hard to monitor 1 camera or 1000 cameras, so I want to have a plugin that can be easily called similar to the way check_http and the like create quick service checks. Currently check_http and check_https are the only functions I am monitoring, but this only tells me things are alive but not much else.

    Any help on some good tutes and learning material will be massively appreciated. Ultimately I'd love to get it to the point where it can detect failures via the API calls and whatnot or hint at them before they happen.

    Cheers

  2. #2
    Administrator Frescha's Avatar
    Join Date
    May 2011
    Posts
    183

    Re: Learn to create new plugins

    In which programming language?

  3. #3
    Junior Member
    Join Date
    Jan 2014
    Posts
    4

    Re: Learn to create new plugins

    I'm flexible on that front, was planning Perl though.

  4. #4
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Learn to create new plugins

    You can get a look at how monitoring-plugins are coded, especially in the contrib dir that got several perl plugins that will show you how to "code" a plugin, you will see that it's just too easy:

    * print a line
    * return code 0=OK, 1=warning, 2=critical

    that's all
    No direct support by personal message. Please open a thread so everyone can see the solution

  5. #5
    Administrator Frescha's Avatar
    Join Date
    May 2011
    Posts
    183

    Re: Learn to create new plugins

    Have a look at monitoring plugins development guidelines https://www.monitoring-plugins.org/doc/guidelines.html

  6. #6

    Re: Learn to create new plugins

    Don't forget return code 3=Unknown

    Good luck with your script

    David


  7. #7
    Plugins are extraordinary assets since they allow your site to accomplish things it generally wouldn't have the option to do. Be that as it may, the more plugins you the greater the risk of issues happening inside your site. Plugin issues can be arbitrary and surprising, or increasingly explicit issues related to the plugin. Write My College Paper For Me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •