Solved

check_disk_smb Nagios

Posted on 2007-03-20
11
7,639 Views
Last Modified: 2013-12-06
Hey All,

I have recently implemented nagios 2.7 on fedora core 6. I am trying the plugin check_disk_smb. I can run the command manually from the command line like this.

check_disk_smb -H ipaddress -s sharename  -u username -p password

This works fine I get the percentage of disk left. But if I add this command to the commands.cfg file like this

define command{
        command_name    check_disk_smb
        command_line    $USER1$/check_disk_smb -H $HOSTADDRESS$ -s $ARG1$ -u $ARG2$ -p $ARG3$
        }
and to the host file like this

define service{
        use                             local-service         ; Name of service template to use
        host_name                       host.com
        service_description             Disk Space
        check_command      check_disk_smb!sharename!username!password
        }

I get an error everytime either critical error access denied or invalid warning threshold -H
any help is appreciated.
0
Comment
Question by:wilsj
  • 6
  • 5
11 Comments
 
LVL 14

Expert Comment

by:pablouruguay
ID: 18762407
yes because you forgive the hostname
check_command      check_disk_smb!HOSTNAME!sharename!username!password
0
 
LVL 5

Author Comment

by:wilsj
ID: 18763792
Im sorry I put something wrong above the information I put for the host file is actually in ther services.cfg Nagios automatically pulls the host name from the hosts.cfg. The correct host name is in the hosts file but I don't believe it has to be in the services.cfg file.
0
 
LVL 14

Expert Comment

by:pablouruguay
ID: 18764350
you made the modification i was suggest?  aqnyway.. you can try change arg1 for arg0 et all
0
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 
LVL 5

Author Comment

by:wilsj
ID: 18764550
when I start out with $ARG0$ the process just skips over it and goes straight to $ARG1$
0
 
LVL 14

Expert Comment

by:pablouruguay
ID: 18764715
i thinks is in this way

# 'check_disk_smb' command definition
define command{
   command_name   check_disk_smb
   command_line   $USER1$/check_disk_smb -H $HOSTADDRESS$ -s $ARG1$ -u $ARG2$ -p $ARG3$ -w $ARG4$ -c $ARG5$
   }


# Service definition
define service{
   use            generic-service      ; Name of service template to use
   host_name         <Hostname>
   service_description     SMB_Disk
   max_check_attempts      3
   normal_check_interval      15
   retry_check_interval    1
   process_perf_data    1
   contact_groups       xxx
   servicegroups        xxx
   check_command        check_disk_smb!<sharename>!<user>!<password>!<warning>!<critical>
   }
0
 
LVL 5

Author Comment

by:wilsj
ID: 18764779
I tried the above and I get an  Access Denied error. I know the share, username and password are correct. Because if I run the above manually it works fine. If there some kind of weird thing with nagios that it isn't reading the information right?
0
 
LVL 14

Expert Comment

by:pablouruguay
ID: 18764817
just a question... you have a user nagios? you run this command with the user nagios or the user root? please run the command with the user nagios and check if connect anyway
0
 
LVL 5

Author Comment

by:wilsj
ID: 18764991
Good idea. I tried to swtich users to nagios and I get this. I added the user and group before I installed I don't know why this would happen.

su nagios
This account is currently not available.
0
 
LVL 14

Expert Comment

by:pablouruguay
ID: 18765225
check in your /etc/passwd if nagios have a shell to login
0
 
LVL 5

Author Comment

by:wilsj
ID: 18765293
I just changed the /etc/passwd it was setup for no login. Now I will check and see if the process works
0
 
LVL 14

Accepted Solution

by:
pablouruguay earned 500 total points
ID: 18765305
ok. work done! :)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question