# Nagios plugins

**URL:** <https://discourse.chef.io/t/nagios-plugins/4370>\
**Category:** Chef Infra (archive)\
**Created:** [August 28, 2013, 5:05pm UTC](https://discourse.chef.io/t/nagios-plugins/4370 "2013-08-28T17:05:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [August 28, 2013, 5:05pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/1 "2013-08-28T17:05:48Z")

</div>

With some difficulties, I was able to deploy out the nagios cookbook.

[https://github.com/opscode-cookbooks/nagios](https://github.com/opscode-cookbooks/nagios)…

However, I noticed there was no “custom plugins location” so I created one  
under files with the following recipe:

remote\_directory node[‘nagios’][‘plugin\_dir’] do  
source "plugins"  
owner "nagios"  
group "nagios"  
mode 0775  
recursive true  
end

However, everytime I push up a new custom plugin, it’s not accepting my mode  
0755 and I keep getting the following when I run chef-client

change mode from ‘’ to '0644

–

What is changing overriding my mode 755?

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [August 28, 2013, 5:09pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/2 "2013-08-28T17:09:39Z")

</div>

On Wednesday, August 28, 2013 at 10:05 AM, [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:

> With some difficulties, I was able to deploy out the nagios cookbook.
> 
> [GitHub - sous-chefs/nagios: Development repository for the nagios cookbook](https://github.com/opscode-cookbooks/nagios)...
> 
> However, I noticed there was no "custom plugins location" so I created one  
> under files with the following recipe:
> 
> remote\_directory node['nagios']['plugin\_dir'] do  
> source "plugins"  
> owner "nagios"  
> group "nagios"  
> mode 0775  
> recursive true  
> end
> 
> However, everytime I push up a new custom plugin, it's not accepting my mode  
> 0755 and I keep getting the following when I run chef-client
> 
> change mode from '' to '0644

What is right above this line? You should see the name of the resource that's making the change.

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [August 28, 2013, 5:50pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/3 "2013-08-28T17:50:26Z")

</div>

The above lines above that are as follow:

Recipe:

- file[/etc/nagios/nrpe.d/check\_procs.cfg] action create (up to date)  
Recipe: nagios::custom\_plugins
- remote\_directory[/usr/lib64/nagios/plugins] action createRecipe: 
- cookbook\_file[/usr/lib64/nagios/plugins/nagios\_helper.rb] action create (up to date)
- cookbook\_file[/usr/lib64/nagios/plugins/file\_queues.rb] action create (up to date)
- cookbook\_file[/usr/lib64/nagios/plugins/db\_queues.rb] action create (up to date)
- cookbook\_file[/usr/lib64/nagios/plugins/check\_solr.rb] action create (up to date)
- cookbook\_file[/usr/lib64/nagios/plugins/check\_redis.py] action create
  - create new file /usr/lib64/nagios/plugins/check\_redis.py
  - update content in file /usr/lib64/nagios/plugins/check\_redis.py from none to e1fb11  
--- /usr/lib64/nagios/plugins/check\_redis.py 2013-08-28 12:39:07.000000000 -0400  
+++ /tmp/.check\_redis.py20130828-10728-1bhiecr 2013-08-28 12:39:07.000000000 -0400  
@@ -0,0 +1,57 @@  
+#!/usr/bin/python  
+  
+import socket  
+import sys  
+from optparse import OptionParser  
+  
+EXIT\_OK = 0  
+EXIT\_WARN = 1  
+EXIT\_CRITICAL = 2  
+  
+def get\_info(host, port, timeout):
    - socket.setdefaulttimeout(timeout or None)
    - s = socket.socket(socket.AF\_INET, socket.SOCK\_STREAM)
    - s.connect((host, port))
    - s.send("\*1\r\n$4\r\ninfo\r\n")
    - buf = ""
    - while '\r\n\r\n' not in buf:
    - 

```
   buf += s.recv(1024)

```

    - s.close()
    - return dict(x.split(':', 1) for x in buf.split('\r\n') if ':' in x)
    - 

+def build\_parser():
    - parser = OptionParser()
    - parser.add\_option("-s", "--server", dest="server", help="Redis server to connect to.", default="127.0.0.1")
    - parser.add\_option("-p", "--port", dest="port", help="Redis port to connect to.", type="int", default=6379)
    - parser.add\_option("-w", "--warn", dest="warn\_memory", help="Memory utilization (in MB) that triggers a warning status.", type="int")
    - parser.add\_option("-c", "--critical", dest="crit\_memory", help="Memory utilization (in MB) that triggers a critical status.", type="int")
    - parser.add\_option("-t", "--timeout", dest="timeout", help="Number of milliesconds to wait before timing out and considering redis down", type="int", default=2000)
    - return parser
    - 

+def main():
    - parser = build\_parser()
    - options, \_args = parser.parse\_args()
    - if not options.warn\_memory:
    - 

```
   parser.error("Warning level required")

```

    - if not options.crit\_memory:
    - 

```
   parser.error("Critical level required")

```

    - 
    - try:
    - 

```
   info = get_info(options.server, int(options.port), timeout=options.timeout / 1000.0)

```

    - except socket.error, exc:
    - 

```
   print "CRITICAL: Error connecting or getting INFO from redis %s:%s: %s" % (options.server, options.port, exc)

```

    - 

```
   sys.exit(EXIT_CRITICAL)

```

    - 
    - memory = int(info.get("used\_memory\_rss") or info["used\_memory"]) / (1024\*1024)
    - if memory \> options.crit\_memory:
    - 

```
   print "CRITICAL: Redis memory usage is %dMB (threshold %dMB)" % (memory, options.crit_memory)

```

    - 

```
   sys.exit(EXIT_CRITICAL)

```

    - elif memory \> options.warn\_memory:
    - 

```
   print "WARN: Redis memory usage is %dMB (threshold %dMB)" % (memory, options.warn_memory)

```

    - 

```
   sys.exit(EXIT_WARN)

```

    - 
    - print "OK: Redis memory usage is %dMB" % memory
    - sys.exit(EXIT\_OK)
    - 

+if **name** == " **main**":
    - main()

Nikhil Shah / System Administrator  
[nshah@theorchard.com](mailto:nshah@theorchard.com)

The Orchard® / [www.theorchard.com](http://www.theorchard.com)

t (+1) 212.308.5648 / f (+1) 212.201.9203  
23 E. 4th St., 3rd Fl / New York, NY 10003

The Daily Rind™ / [www.dailyrindblog.com](http://www.dailyrindblog.com)  
Facebook / @orchtweets

Privileged And Confidential Communication.  
This electronic transmission, and any documents attached hereto, (a) are protected by the Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain confidential and/or legally privileged information, and (c) are for the sole use of the intended recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of the information received in error is strictly prohibited.

On Aug 28, 2013, at 1:09 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Wednesday, August 28, 2013 at 10:05 AM, [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> 
> > With some difficulties, I was able to deploy out the nagios cookbook.
> > 
> > [GitHub - sous-chefs/nagios: Development repository for the nagios cookbook](https://github.com/opscode-cookbooks/nagios)...
> > 
> > However, I noticed there was no "custom plugins location" so I created one  
> > under files with the following recipe:
> > 
> > remote\_directory node['nagios']['plugin\_dir'] do  
> > source "plugins"  
> > owner "nagios"  
> > group "nagios"  
> > mode 0775  
> > recursive true  
> > end
> > 
> > However, everytime I push up a new custom plugin, it's not accepting my mode  
> > 0755 and I keep getting the following when I run chef-client
> > 
> > change mode from '' to '0644
> 
> What is right above this line? You should see the name of the resource that's making the change.
> 
> --  
> Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [August 28, 2013, 7:40pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/4 "2013-08-28T19:40:37Z")

</div>

Also, do you know if there is a way to check windows server? Typically I would using NSClient++; however, I do not see a cookbook for this.  
Nikhil Shah / System Administrator  
[nshah@theorchard.com](mailto:nshah@theorchard.com)

The Orchard® / [www.theorchard.com](http://www.theorchard.com)

t (+1) 212.308.5648 / f (+1) 212.201.9203  
23 E. 4th St., 3rd Fl / New York, NY 10003

The Daily Rind™ / [www.dailyrindblog.com](http://www.dailyrindblog.com)  
Facebook / @orchtweets

Privileged And Confidential Communication.  
This electronic transmission, and any documents attached hereto, (a) are protected by the Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain confidential and/or legally privileged information, and (c) are for the sole use of the intended recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of the information received in error is strictly prohibited.

On Aug 28, 2013, at 1:09 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Wednesday, August 28, 2013 at 10:05 AM, [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> 
> > With some difficulties, I was able to deploy out the nagios cookbook.
> > 
> > [GitHub - sous-chefs/nagios: Development repository for the nagios cookbook](https://github.com/opscode-cookbooks/nagios)...
> > 
> > However, I noticed there was no "custom plugins location" so I created one  
> > under files with the following recipe:
> > 
> > remote\_directory node['nagios']['plugin\_dir'] do  
> > source "plugins"  
> > owner "nagios"  
> > group "nagios"  
> > mode 0775  
> > recursive true  
> > end
> > 
> > However, everytime I push up a new custom plugin, it's not accepting my mode  
> > 0755 and I keep getting the following when I run chef-client
> > 
> > change mode from '' to '0644
> 
> What is right above this line? You should see the name of the resource that's making the change.
> 
> --  
> Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Tim\_Smith1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tim_smith1/32/283_2.png) [@Tim\_Smith1](https://discourse.chef.io/u/Tim_Smith1)\
**Post date:** [August 28, 2013, 8:29pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/5 "2013-08-28T20:29:19Z")

</div>

NSClient++ can be used for Windows hosts, but there is not a cookbook that I know of for that right now. In general the idea behind the plugins is that this should be handled outside of the nagios cookbook itself. You should create a wrapper cookbook that drops the plugin files into the correct directory and then you should use the NRPE LWRP to create that check that uses the plugin. That way you avoid modifying the nagios cookbook and having to merge in changes from later community releases. In the past the nagios cookbook included a large number of commonly used plugins and hardcoded those into the NRPE config. It was a bit of a nightmare as every environment uses the checks a bit differently. We chose to remove them all and leave it up to the user to decide what they wanted.

-Tim

Tim Smith - Systems Engineer  
m: +1 707.738.8132

On Aug 28, 2013, at 12:40 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:

> Also, do you know if there is a way to check windows server? Typically I would using NSClient++; however, I do not see a cookbook for this.  
> Nikhil Shah / System Administrator  
> [nshah@theorchard.com](mailto:nshah@theorchard.com)
> 
> The Orchard® / [www.theorchard.com](http://www.theorchard.com)
> 
> t (+1) 212.308.5648 / f (+1) 212.201.9203  
> 23 E. 4th St., 3rd Fl / New York, NY 10003
> 
> The Daily Rind™ / [www.dailyrindblog.com](http://www.dailyrindblog.com)  
> Facebook / @orchtweets
> 
> Privileged And Confidential Communication.  
> This electronic transmission, and any documents attached hereto, (a) are protected by the Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain confidential and/or legally privileged information, and (c) are for the sole use of the intended recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of the information received in error is strictly prohibited.
> 
> On Aug 28, 2013, at 1:09 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> 
> > On Wednesday, August 28, 2013 at 10:05 AM, [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> > 
> > > With some difficulties, I was able to deploy out the nagios cookbook.
> > > 
> > > [GitHub - sous-chefs/nagios: Development repository for the nagios cookbook](https://github.com/opscode-cookbooks/nagios)...
> > > 
> > > However, I noticed there was no "custom plugins location" so I created one  
> > > under files with the following recipe:
> > > 
> > > remote\_directory node['nagios']['plugin\_dir'] do  
> > > source "plugins"  
> > > owner "nagios"  
> > > group "nagios"  
> > > mode 0775  
> > > recursive true  
> > > end
> > > 
> > > However, everytime I push up a new custom plugin, it's not accepting my mode  
> > > 0755 and I keep getting the following when I run chef-client
> > > 
> > > change mode from '' to '0644
> > 
> > What is right above this line? You should see the name of the resource that's making the change.
> > 
> > --  
> > Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [August 28, 2013, 8:38pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/6 "2013-08-28T20:38:10Z")

</div>

Tim,

I just created a new receipe that I call within my roles. I was going to  
had an override attribute/default attribute that chmod's the plugin for  
755; however, it seems like something is overwriting that. I just don't  
know what/why it would change the plugin to 644 which doesn't allow for it  
to execute.

As for the NSClient++ - I can have that manually dropped and installed on  
the windows (wish there was a cookbook that would do this; however, i would  
not be able to controls distributed changes across all windows servers.  
What has been done previously by others?

On Wed, Aug 28, 2013 at 4:29 PM, Tim Smith [tsmith@llnw.com](mailto:tsmith@llnw.com) wrote:

> NSClient++ can be used for Windows hosts, but there is not a cookbook that  
> I know of for that right now. In general the idea behind the plugins is  
> that this should be handled outside of the nagios cookbook itself. You  
> should create a wrapper cookbook that drops the plugin files into the  
> correct directory and then you should use the NRPE LWRP to create that  
> check that uses the plugin. That way you avoid modifying the nagios  
> cookbook and having to merge in changes from later community releases. In  
> the past the nagios cookbook included a large number of commonly used  
> plugins and hardcoded those into the NRPE config. It was a bit of a  
> nightmare as every environment uses the checks a bit differently. We chose  
> to remove them all and leave it up to the user to decide what they wanted.
> 
> -Tim  
> [image: Limelight Networks] [http://www.limelight.com/](http://www.limelight.com/)Tim Smith - Systems  
> Engineer  
> _m:_ +1 707.738.8132
> 
> On Aug 28, 2013, at 12:40 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> 
> Also, do you know if there is a way to check windows server? Typically I  
> would using NSClient++; however, I do not see a cookbook for this.  
> \*Nikhil Shah \*/ System Administrator  
> [nshah@theorchard.com](mailto:nshah@theorchard.com) [drudolph@theorchard.com](mailto:drudolph@theorchard.com)
> 
> _The Orchard®_ / [www.theorchard.com](http://www.theorchard.com)
> 
> t (+1) 212.308.5648 / f (+1) 212.201.9203  
> 23 E. 4th St., 3rd Fl / New York, NY 10003
> 
> The Daily Rind™ / _[www.dailyrindblog.com](http://www.dailyrindblog.com)_ [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/)  
> _Facebook_ [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) / _@orchtweets_[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets)
> 
> Privileged And Confidential Communication.  
> This electronic transmission, and any documents attached hereto, (a) are  
> protected by the Electronic Communications Privacy Act (18 USC §§  
> 2510-2521), (b) may contain confidential and/or legally privileged  
> information, and (c) are for the sole use of the intended recipient named  
> above. If you have received this electronic message in error, please notify  
> the sender and delete the electronic message. Any disclosure, copying,  
> distribution, or use of the contents of the information received in error  
> is strictly prohibited.  
> \*
> 
> - 
> 
> On Aug 28, 2013, at 1:09 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> 
> On Wednesday, August 28, 2013 at 10:05 AM, [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> 
> With some difficulties, I was able to deploy out the nagios cookbook.
> 
> [GitHub - sous-chefs/nagios: Development repository for the nagios cookbook](https://github.com/opscode-cookbooks/nagios)...
> 
> However, I noticed there was no "custom plugins location" so I created one  
> under files with the following recipe:
> 
> remote\_directory node['nagios']['plugin\_dir'] do  
> source "plugins"  
> owner "nagios"  
> group "nagios"  
> mode 0775  
> recursive true  
> end
> 
> However, everytime I push up a new custom plugin, it's not accepting my  
> mode  
> 0755 and I keep getting the following when I run chef-client
> 
> change mode from '' to '0644
> 
> What is right above this line? You should see the name of the resource  
> that's making the change.
> 
> --  
> Daniel DeLeo

--

- Nikhil Shah \*/ System Administrator

[nshah@theorchard.com](mailto:nshah@theorchard.com)

_The Orchard®_ / [www.theorchard.com](http://www.theorchard.com)

t (+1) 212.308.5648 / f (+1) 212.201.9203  
23 E. 4th St., 3rd Fl / New York, NY 10003

The Daily Rind™ / _[www.dailyrindblog.com](http://www.dailyrindblog.com)_ [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/)

_Facebook_ [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) /  
_@orchtweets_[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets)

Privileged And Confidential Communication.

This electronic transmission, and any documents attached hereto, (a) are  
protected by the Electronic Communications Privacy Act (18 USC §§  
2510-2521), (b) may contain confidential and/or legally privileged  
information, and (c) are for the sole use of the intended recipient named  
above. If you have received this electronic message in error, please notify  
the sender and delete the electronic message. Any disclosure, copying,  
distribution, or use of the contents of the information received in error  
is strictly prohibited

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [August 28, 2013, 8:39pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/7 "2013-08-28T20:39:56Z")

</div>

Also, I dont really know how to use NRPE LWRP.

On Wed, Aug 28, 2013 at 4:38 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:

> Tim,
> 
> I just created a new receipe that I call within my roles. I was going to  
> had an override attribute/default attribute that chmod's the plugin for  
> 755; however, it seems like something is overwriting that. I just don't  
> know what/why it would change the plugin to 644 which doesn't allow for it  
> to execute.
> 
> As for the NSClient++ - I can have that manually dropped and installed on  
> the windows (wish there was a cookbook that would do this; however, i would  
> not be able to controls distributed changes across all windows servers.  
> What has been done previously by others?
> 
> On Wed, Aug 28, 2013 at 4:29 PM, Tim Smith [tsmith@llnw.com](mailto:tsmith@llnw.com) wrote:
> 
> > NSClient++ can be used for Windows hosts, but there is not a cookbook  
> > that I know of for that right now. In general the idea behind the plugins  
> > is that this should be handled outside of the nagios cookbook itself. You  
> > should create a wrapper cookbook that drops the plugin files into the  
> > correct directory and then you should use the NRPE LWRP to create that  
> > check that uses the plugin. That way you avoid modifying the nagios  
> > cookbook and having to merge in changes from later community releases. In  
> > the past the nagios cookbook included a large number of commonly used  
> > plugins and hardcoded those into the NRPE config. It was a bit of a  
> > nightmare as every environment uses the checks a bit differently. We chose  
> > to remove them all and leave it up to the user to decide what they wanted.
> > 
> > -Tim  
> > [image: Limelight Networks] [http://www.limelight.com/](http://www.limelight.com/) Tim Smith - Systems  
> > Engineer  
> > _m:_ +1 707.738.8132
> > 
> > On Aug 28, 2013, at 12:40 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> > 
> > Also, do you know if there is a way to check windows server? Typically I  
> > would using NSClient++; however, I do not see a cookbook for this.  
> > \*Nikhil Shah \*/ System Administrator  
> > [nshah@theorchard.com](mailto:nshah@theorchard.com) [drudolph@theorchard.com](mailto:drudolph@theorchard.com)
> > 
> > _The Orchard®_ / [www.theorchard.com](http://www.theorchard.com)
> > 
> > t (+1) 212.308.5648 / f (+1) 212.201.9203  
> > 23 E. 4th St., 3rd Fl / New York, NY 10003
> > 
> > The Daily Rind™ / _[www.dailyrindblog.com](http://www.dailyrindblog.com)_ [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/)  
> > _Facebook_ [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) / _@orchtweets_[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets)
> > 
> > Privileged And Confidential Communication.  
> > This electronic transmission, and any documents attached hereto, (a) are  
> > protected by the Electronic Communications Privacy Act (18 USC §§  
> > 2510-2521), (b) may contain confidential and/or legally privileged  
> > information, and (c) are for the sole use of the intended recipient named  
> > above. If you have received this electronic message in error, please notify  
> > the sender and delete the electronic message. Any disclosure, copying,  
> > distribution, or use of the contents of the information received in error  
> > is strictly prohibited.  
> > \*
> > 
> > - 
> > 
> > On Aug 28, 2013, at 1:09 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> > 
> > On Wednesday, August 28, 2013 at 10:05 AM, [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> > 
> > With some difficulties, I was able to deploy out the nagios cookbook.
> > 
> > [GitHub - sous-chefs/nagios: Development repository for the nagios cookbook](https://github.com/opscode-cookbooks/nagios)...
> > 
> > However, I noticed there was no "custom plugins location" so I created one  
> > under files with the following recipe:
> > 
> > remote\_directory node['nagios']['plugin\_dir'] do  
> > source "plugins"  
> > owner "nagios"  
> > group "nagios"  
> > mode 0775  
> > recursive true  
> > end
> > 
> > However, everytime I push up a new custom plugin, it's not accepting my  
> > mode  
> > 0755 and I keep getting the following when I run chef-client
> > 
> > change mode from '' to '0644
> > 
> > What is right above this line? You should see the name of the resource  
> > that's making the change.
> > 
> > --  
> > Daniel DeLeo
> 
> --
> 
> - Nikhil Shah \*/ System Administrator
> 
> [nshah@theorchard.com](mailto:nshah@theorchard.com)
> 
> _The Orchard®_ / [www.theorchard.com](http://www.theorchard.com)
> 
> t (+1) 212.308.5648 / f (+1) 212.201.9203  
> 23 E. 4th St., 3rd Fl / New York, NY 10003
> 
> The Daily Rind™ / _[www.dailyrindblog.com](http://www.dailyrindblog.com)_ [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/)
> 
> _Facebook_ [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) / _@orchtweets_[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets)
> 
> Privileged And Confidential Communication.
> 
> This electronic transmission, and any documents attached hereto, (a) are  
> protected by the Electronic Communications Privacy Act (18 USC §§  
> 2510-2521), (b) may contain confidential and/or legally privileged  
> information, and (c) are for the sole use of the intended recipient named  
> above. If you have received this electronic message in error, please notify  
> the sender and delete the electronic message. Any disclosure, copying,  
> distribution, or use of the contents of the information received in error  
> is strictly prohibited

--

- Nikhil Shah \*/ System Administrator

[nshah@theorchard.com](mailto:nshah@theorchard.com)

_The Orchard®_ / [www.theorchard.com](http://www.theorchard.com)

t (+1) 212.308.5648 / f (+1) 212.201.9203  
23 E. 4th St., 3rd Fl / New York, NY 10003

The Daily Rind™ / _[www.dailyrindblog.com](http://www.dailyrindblog.com)_ [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/)

_Facebook_ [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) /  
_@orchtweets_[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets)

Privileged And Confidential Communication.

This electronic transmission, and any documents attached hereto, (a) are  
protected by the Electronic Communications Privacy Act (18 USC §§  
2510-2521), (b) may contain confidential and/or legally privileged  
information, and (c) are for the sole use of the intended recipient named  
above. If you have received this electronic message in error, please notify  
the sender and delete the electronic message. Any disclosure, copying,  
distribution, or use of the contents of the information received in error  
is strictly prohibited

---

<div class="post-metadata">

**Author:** ![Mat\_Davies](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/mat_davies/32/446_2.png) [@Mat\_Davies](https://discourse.chef.io/u/Mat_Davies)\
**Post date:** [September 2, 2013, 2:10pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/8 "2013-09-02T14:10:01Z")

</div>

Nikhil

on the NSClient++ try using the chocolatey cookbook I use that with a  
quick custom cookbook

the main recipe is

"include\_recipe "chocolatey"

if node['kernel']['machine'] == "x86\_64"  
chocolatey "NSClientPlusPlus.x64"else  
chocolatey "NSClientPlusPlus.x86"  
end

template "#{node['chocolatey-base-packages']['nsclientpath']}NSC.ini" do  
source "NSC.ini.erb"  
action :create  
notifies :restart, "service[NSClientpp]", :immediately  
end

service "NSClientpp" do  
service\_name "NSClientpp"  
supports :start =\> true, :stop =\> true, :restart =\> true  
action [:restart, :enable]

end"

then just create a template NSC.ini.erb

haven't bothered putting it up on community yet as I was planning on  
putting some reasonable attributes in the template first but haven't had a  
chance.

-Mat

On 28 August 2013 21:38, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:

> Tim,
> 
> I just created a new receipe that I call within my roles. I was going to  
> had an override attribute/default attribute that chmod's the plugin for  
> 755; however, it seems like something is overwriting that. I just don't  
> know what/why it would change the plugin to 644 which doesn't allow for it  
> to execute.
> 
> As for the NSClient++ - I can have that manually dropped and installed on  
> the windows (wish there was a cookbook that would do this; however, i would  
> not be able to controls distributed changes across all windows servers.  
> What has been done previously by others?
> 
> On Wed, Aug 28, 2013 at 4:29 PM, Tim Smith [tsmith@llnw.com](mailto:tsmith@llnw.com) wrote:
> 
> > NSClient++ can be used for Windows hosts, but there is not a cookbook  
> > that I know of for that right now. In general the idea behind the plugins  
> > is that this should be handled outside of the nagios cookbook itself. You  
> > should create a wrapper cookbook that drops the plugin files into the  
> > correct directory and then you should use the NRPE LWRP to create that  
> > check that uses the plugin. That way you avoid modifying the nagios  
> > cookbook and having to merge in changes from later community releases. In  
> > the past the nagios cookbook included a large number of commonly used  
> > plugins and hardcoded those into the NRPE config. It was a bit of a  
> > nightmare as every environment uses the checks a bit differently. We chose  
> > to remove them all and leave it up to the user to decide what they wanted.
> > 
> > -Tim  
> > [image: Limelight Networks] [http://www.limelight.com/](http://www.limelight.com/) Tim Smith - Systems  
> > Engineer  
> > _m:_ +1 707.738.8132
> > 
> > On Aug 28, 2013, at 12:40 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> > 
> > Also, do you know if there is a way to check windows server? Typically I  
> > would using NSClient++; however, I do not see a cookbook for this.  
> > \*Nikhil Shah \*/ System Administrator  
> > [nshah@theorchard.com](mailto:nshah@theorchard.com) [drudolph@theorchard.com](mailto:drudolph@theorchard.com)
> > 
> > _The Orchard®_ / [www.theorchard.com](http://www.theorchard.com)
> > 
> > t (+1) 212.308.5648 / f (+1) 212.201.9203  
> > 23 E. 4th St., 3rd Fl / New York, NY 10003
> > 
> > The Daily Rind™ / _[www.dailyrindblog.com](http://www.dailyrindblog.com)_ [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/)  
> > _Facebook_ [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) / _@orchtweets_[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets)
> > 
> > Privileged And Confidential Communication.  
> > This electronic transmission, and any documents attached hereto, (a) are  
> > protected by the Electronic Communications Privacy Act (18 USC §§  
> > 2510-2521), (b) may contain confidential and/or legally privileged  
> > information, and (c) are for the sole use of the intended recipient named  
> > above. If you have received this electronic message in error, please notify  
> > the sender and delete the electronic message. Any disclosure, copying,  
> > distribution, or use of the contents of the information received in error  
> > is strictly prohibited.  
> > \*
> > 
> > - 
> > 
> > On Aug 28, 2013, at 1:09 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> > 
> > On Wednesday, August 28, 2013 at 10:05 AM, [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> > 
> > With some difficulties, I was able to deploy out the nagios cookbook.
> > 
> > [GitHub - sous-chefs/nagios: Development repository for the nagios cookbook](https://github.com/opscode-cookbooks/nagios)...
> > 
> > However, I noticed there was no "custom plugins location" so I created one  
> > under files with the following recipe:
> > 
> > remote\_directory node['nagios']['plugin\_dir'] do  
> > source "plugins"  
> > owner "nagios"  
> > group "nagios"  
> > mode 0775  
> > recursive true  
> > end
> > 
> > However, everytime I push up a new custom plugin, it's not accepting my  
> > mode  
> > 0755 and I keep getting the following when I run chef-client
> > 
> > change mode from '' to '0644
> > 
> > What is right above this line? You should see the name of the resource  
> > that's making the change.
> > 
> > --  
> > Daniel DeLeo
> 
> --
> 
> - Nikhil Shah \*/ System Administrator
> 
> [nshah@theorchard.com](mailto:nshah@theorchard.com)
> 
> _The Orchard®_ / [www.theorchard.com](http://www.theorchard.com)
> 
> t (+1) 212.308.5648 / f (+1) 212.201.9203  
> 23 E. 4th St., 3rd Fl / New York, NY 10003
> 
> The Daily Rind™ / _[www.dailyrindblog.com](http://www.dailyrindblog.com)_ [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/)
> 
> _Facebook_ [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) / _@orchtweets_[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets)
> 
> Privileged And Confidential Communication.
> 
> This electronic transmission, and any documents attached hereto, (a) are  
> protected by the Electronic Communications Privacy Act (18 USC §§  
> 2510-2521), (b) may contain confidential and/or legally privileged  
> information, and (c) are for the sole use of the intended recipient named  
> above. If you have received this electronic message in error, please notify  
> the sender and delete the electronic message. Any disclosure, copying,  
> distribution, or use of the contents of the information received in error  
> is strictly prohibited

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [September 2, 2013, 5:20pm UTC](https://discourse.chef.io/t/nagios-plugins/4370/9 "2013-09-02T17:20:36Z")

</div>

Matt,

I will be touching base with you! I think you may have really helped me out.

Thanks,

Nikhil Shah

On Sep 2, 2013, at 10:10 AM, Mat Davies [ashmere@gmail.com](mailto:ashmere@gmail.com) wrote:

> Nikhil
> 
> on the NSClient++ try using the chocolatey cookbook I use that with a quick custom cookbook
> 
> the main recipe is
> 
> "include\_recipe "chocolatey"
> 
> if node['kernel']['machine'] == "x86\_64"  
> chocolatey "NSClientPlusPlus.x64"  
> else  
> chocolatey "NSClientPlusPlus.x86"  
> end
> 
> template "#{node['chocolatey-base-packages']['nsclientpath']}NSC.ini" do  
> source "NSC.ini.erb"  
> action :create  
> notifies :restart, "service[NSClientpp]", :immediately  
> end
> 
> service "NSClientpp" do  
> service\_name "NSClientpp"  
> supports :start =\> true, :stop =\> true, :restart =\> true  
> action [:restart, :enable]  
> end"
> 
> then just create a template NSC.ini.erb
> 
> haven't bothered putting it up on community yet as I was planning on putting some reasonable attributes in the template first but haven't had a chance.
> 
> -Mat
> 
> On 28 August 2013 21:38, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> 
> > Tim,
> > 
> > I just created a new receipe that I call within my roles. I was going to had an override attribute/default attribute that chmod's the plugin for 755; however, it seems like something is overwriting that. I just don't know what/why it would change the plugin to 644 which doesn't allow for it to execute.
> > 
> > As for the NSClient++ - I can have that manually dropped and installed on the windows (wish there was a cookbook that would do this; however, i would not be able to controls distributed changes across all windows servers. What has been done previously by others?
> > 
> > On Wed, Aug 28, 2013 at 4:29 PM, Tim Smith [tsmith@llnw.com](mailto:tsmith@llnw.com) wrote:
> > 
> > > NSClient++ can be used for Windows hosts, but there is not a cookbook that I know of for that right now. In general the idea behind the plugins is that this should be handled outside of the nagios cookbook itself. You should create a wrapper cookbook that drops the plugin files into the correct directory and then you should use the NRPE LWRP to create that check that uses the plugin. That way you avoid modifying the nagios cookbook and having to merge in changes from later community releases. In the past the nagios cookbook included a large number of commonly used plugins and hardcoded those into the NRPE config. It was a bit of a nightmare as every environment uses the checks a bit differently. We chose to remove them all and leave it up to the user to decide what they wanted.
> > > 
> > > -Tim
> > > 
> > > Tim Smith - Systems Engineer  
> > > m: +1 707.738.8132
> > > 
> > > On Aug 28, 2013, at 12:40 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> > > 
> > > > Also, do you know if there is a way to check windows server? Typically I would using NSClient++; however, I do not see a cookbook for this.  
> > > > Nikhil Shah / System Administrator  
> > > > [nshah@theorchard.com](mailto:nshah@theorchard.com)
> > > > 
> > > > The Orchard® / [www.theorchard.com](http://www.theorchard.com)
> > > > 
> > > > t (+1) 212.308.5648 / f (+1) 212.201.9203  
> > > > 23 E. 4th St., 3rd Fl / New York, NY 10003
> > > > 
> > > > The Daily Rind™ / [www.dailyrindblog.com](http://www.dailyrindblog.com)  
> > > > Facebook / @orchtweets
> > > > 
> > > > Privileged And Confidential Communication.  
> > > > This electronic transmission, and any documents attached hereto, (a) are protected by the Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain confidential and/or legally privileged information, and (c) are for the sole use of the intended recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of the information received in error is strictly prohibited.
> > > > 
> > > > On Aug 28, 2013, at 1:09 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> > > > 
> > > > > On Wednesday, August 28, 2013 at 10:05 AM, [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> > > > > 
> > > > > > With some difficulties, I was able to deploy out the nagios cookbook.
> > > > > > 
> > > > > > [GitHub - sous-chefs/nagios: Development repository for the nagios cookbook](https://github.com/opscode-cookbooks/nagios)...
> > > > > > 
> > > > > > However, I noticed there was no "custom plugins location" so I created one  
> > > > > > under files with the following recipe:
> > > > > > 
> > > > > > remote\_directory node['nagios']['plugin\_dir'] do  
> > > > > > source "plugins"  
> > > > > > owner "nagios"  
> > > > > > group "nagios"  
> > > > > > mode 0775  
> > > > > > recursive true  
> > > > > > end
> > > > > > 
> > > > > > However, everytime I push up a new custom plugin, it's not accepting my mode  
> > > > > > 0755 and I keep getting the following when I run chef-client
> > > > > > 
> > > > > > change mode from '' to '0644
> > > > > 
> > > > > What is right above this line? You should see the name of the resource that's making the change.
> > > > > 
> > > > > --  
> > > > > Daniel DeLeo
> > 
> > --  
> > Nikhil Shah / System Administrator
> > 
> > [nshah@theorchard.com](mailto:nshah@theorchard.com)
> > 
> > The Orchard® / [www.theorchard.com](http://www.theorchard.com)
> > 
> > t (+1) 212.308.5648 / f (+1) 212.201.9203  
> > 23 E. 4th St., 3rd Fl / New York, NY 10003
> > 
> > The Daily Rind™ / [www.dailyrindblog.com](http://www.dailyrindblog.com)
> > 
> > Facebook / @orchtweets
> > 
> > Privileged And Confidential Communication.
> > 
> > This electronic transmission, and any documents attached hereto, (a) are protected by the Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain confidential and/or legally privileged information, and (c) are for the sole use of the intended recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of the information received in error is strictly prohibited
