USEDDISKSPACE wrong -l argument?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

USEDDISKSPACE wrong -l argument?

Post by jbruyet »

Hey all, I'm trying to pull a reading of hard drive space off of my servers and I've hit a bit of a snag. This is my drive space definition:

define service{
use generic-service
hostgroup_name WinServers
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}

Yeah, this is the stock Nagios definition (well, I changed host_name to hostgroup_name). When I check the server drive space in Nagios the status is unknown and I get the following error message:

wrong -l argument

I've looked for a typo but everything looks pretty good to me, but then again I'm a Nagi newbie so maybe I'm overlooking something. Can anyone see anything wrong with my service definition? FWIW this is my only check_nt definition that doesn't work.

Thanks,

Joe B
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jsmurphy »

That is kinda weird... it looks to be defined correctly... what happens when you execute check_nt with those parameters from the linux command line?
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jbruyet »

Hi jsmurphy, so when I do it from the command line here's what I get:

root@DebNag:/home/jobee# /usr/lib/nagios/plugins/check_nt -H 192.168.2.29 -v USEDDISKSPACE -p 12489 -l c -w 80 -c 90
c:\ - total: 558.72 Gb - used: 283.95 Gb (51%) - free 274.77 Gb (49%) | 'c:\ Used Space'=283.95Gb;446.98;502.85;0.00;558.72

At first I thought it was the port (I was missing that my first couple of attempts at the CLI -- DOH!!!) but check_nt is working with CPU and memory and up-time so I don't think that's it. Can you see anything here that might be causing the problem?

Thanks for looking into this for me,

Joe B
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jsmurphy »

Assuming you haven't changed your check_nt command definition and it still looks like $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$ that is downright bizarre.

It all looks ok and executes fine from the command line as you would expect. About all I can suggest is remove that line, save the file and put it back in again manually typing it (just to be 100% sure everything is correct)... Clutching at straws here though.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jbruyet »

jsmurphy, this is going to sound lame but now I can't find where my command definitions are defined. I've look through the files in /etc/nagios3 and in /etc/nagios3/conf.d but couldn't find anything. I remember adding the -p 12489 because that's how I got the other three Windows definitions working. I'm just about ready to drop this server and build a Suse or a CentOS server so I can get things set up normally from source. Messing with these problems is getting to be a drag, but what's working gives me hope that this is something I can really use.

Thanks for the help,

Joe B
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jsmurphy »

Maybe just run an egrep on the nagios directory for "command" or "define command" that should find the file.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jbruyet »

Hi jsmurphy, and thanks for the heads up on grep; I didn't realize I could put a -r in a grep command string. I'm not a Linux newbie but close. Here's what I get when I grep my Nagios directory:

root@DebNag:/etc/nagios3# grep -r "define command" /etc/nagios3
/etc/nagios3/commands.cfg:define command{
/etc/nagios3/commands.cfg:define command{
/etc/nagios3/commands.cfg:define command{
/etc/nagios3/commands.cfg:define command{
/etc/nagios3/commands.cfg:define command{
root@DebNag:/etc/nagios3#

Here are those command definitions:

define command{
command_name notify-host-by-email
command_line /usr/bin/printf

define command{
command_name notify-service-by-email
command_line /usr/bin/printf

define command{
command_name check_snmp
command_line $USER1$/check_snmp

define command{
command_name process-host-perfdata
command_line /usr/bin/printf

define command{
command_name process-service-perfdata
command_line /usr/bin/printf

As you can see there's nothing about check_nt. I'm currently running the following command to see if there are any nagios directories I'm unaware of that might contain the definition file I'm looking for:

root@DebNag:/etc/nagios3:/etc# grep -r "$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$" /

It's still running and I'm not sure how long it'll run so it's sitting in a PuTTY window all by itself. Here's hoping something pops up that points me to the file or helps me to remember where the file is. ARGH!!!!! I remember adding the -p 12489 and that's when all but the one service check started working. It's not me it's something in this office that's draining my brain power.

Thanks,

Joe B
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jbruyet »

An additional note: after running for about 14 hours the following command hadn't finished. I killed it and moved on.
jbruyet wrote:
root@DebNag:/etc/nagios3:/etc# grep -r "$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$" /
Sigh, I'll probably roll some dice to see which Linux flavor I'll use for my next Nagios install. Debian is just NOT working for me on this.

Thanks for the help jsmurphy,

Joe B
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jsmurphy »

No worries, I've heard plenty of frustrations about running Nagios on Debian though I've never had the pleasure myself. CentOS and Red hat should be fairly problem free, SLES 11 has changed a bit and the install doc is only slightly off but still a good platform, Ubuntu required a bit of fiddling... but that was 3 - 4 years ago that I last did an install on it.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: USEDDISKSPACE wrong -l argument?

Post by jbruyet »

Hey jsmurphy, thanks for ALL your help in this matter. I recently (but not too recently) started using Linux and Debian has served me very well. I've built a couple of Debian servers at my work and they have been problem free. I would have liked to have been able to get Nagios working on a Debian server but I've seen on Google that I'm not alone in struggling with this Nagios/Debian combination. I was leaning toward CentOS as my next choice and your comment convinced me to go that way. Thanks again for your help!

God Bless

Joe B
Locked