What differences between services.cfg and checkcommands.cfg?


HI, I’m newbye for linux and nagios :o, but I have to monotorize a lan.
I followed the documents to intall this software but i find a little of problems to configure it. (nagios 2.02b +pluging 1.4)
I don’t understand the real differences between services.cfg and checkcommands.cfg. :?:

Well, I belive to comprise that I have to specify the exact sintax of command that i use to check in checkcommands.cfg and more general declaration of in in services.cfg.
I’m not sure of it, I belive that if i understand the logical of nagios everything will be more simple. 8)
Moreover I image that user, when he use web interface, uses cgi.cfg file that interrogates nagios.cfg.
This get information from others *.cfg files. Can someone confirme me what I understand? :?

In order to return to real problem to begin with nagios I want to check PING and hard disk usage.
How have I to procede? Have I to define each control in services.cfg and checkcommands.cfg both or …?I have very dubs about the use of these files.


checkcommands.cfg defines commands you are using in services.cfg - another words - services.cfg is telling Nagios to use a specific command from checkcommands.cfg when performing a service check. For example service that checks disk space on the Windows server will look like this:
define service{
use serwis
host_name Windows
service_description Dysk C:
contact_groups group
check_command check_nt_disk!C!80!90
check_command tells Nagios to use check_nt_disk command from checkcommands.cfg

I hope this answers your question


Thank’s but now i have a little problem.
I want to check an hard disk on my linux-server so I have to compile two file : services.cfg and checkcommands.cfg.
In services.cfg i write these rows below:
define service{
host_name sviluppo
service_description check-disk-sda3
check_command check-disk!25%!10%!/dev/sda3!10000!50000
max_check_attempts 5
normal_check_interval 5
retry_check_interval 3
check_period 24x7
notification_interval 30
notification_period 24x7
notification_options n
contact_groups amministrativo
I try to change /dev/sda3 with its path /home but nothing changes.
when i checcommands.cfg I write these below:
define command{
command_name check-disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ -C -w $ARG4$ -c $ARG5$ -H

but from web interface I receive ** "check_disk: Unknown argument - (null) " ** in STATUS INFORMATION


I change notification option with w,u,c,r, but i don’t solve anything


check_disk is a command used to check local disk space so -H is useless. try to use ./check_disk from the commandline in your nagios/libexec directory to see if it’s working (perhaps you’ve given wrong disk label) If it’s working then try going with first three $ARG$ arguments as they are the only ones in the default checkcommandes:

‘check_local_disk’ command definition

define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$


solution is :" have more patience"
Yes, this morning I seat at my pc and everything work OK!
Yesterday I lost a lot of hours to try incredible options…


one thing Nagios will teach you is PATIENCE when you’re a newbie :wink: I read the docs a few times before i started it.


Roog is correct. REading the docs over and over again, is a must. I read them EACH time I install nagios, and I have done several. I follow the instructions from page1 to the last, without skipping anything.