check_disk_smb Nagios

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.
LVL 5
wilsjAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pablouruguayCommented:
yes because you forgive the hostname
check_command      check_disk_smb!HOSTNAME!sharename!username!password
0
wilsjAuthor Commented:
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
pablouruguayCommented:
you made the modification i was suggest?  aqnyway.. you can try change arg1 for arg0 et all
0
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

wilsjAuthor Commented:
when I start out with $ARG0$ the process just skips over it and goes straight to $ARG1$
0
pablouruguayCommented:
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
wilsjAuthor Commented:
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
pablouruguayCommented:
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
wilsjAuthor Commented:
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
pablouruguayCommented:
check in your /etc/passwd if nagios have a shell to login
0
wilsjAuthor Commented:
I just changed the /etc/passwd it was setup for no login. Now I will check and see if the process works
0
pablouruguayCommented:
ok. work done! :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.