Host configuration question

Hello every1. Im new with Nagios. In 2 days fight it was up and running But Im a bit confused with the dependecies of all cfg files to one another… so
I`ve host configuration like this:

define host {
host_name 192.168.77.44
alias 192.168.77.44
address 192.168.77.44
use generic-host
}

my question is: - Is there a way to include a single line or define somehow in every hostfile the host_group(s) for example.
And/or why not all the services associated with the host.
For example now it is the opposite. Im adding hosts to the services I monitor, but Id like to be - Adding services and other parameters into the host-xxx.cfg files.

Thank you in advance!

nagios.sourceforge.net/docs/2_0/ … .html#host
Here you can see that you can define a hostgroup in host definition.
Services are a separate thing from hosts. You have to add hosts to services.

As for last thing you’ve asked, you can make a file printer.cfg and in there you can put host definitions for all printers you monitor and all their services. Later make a file servers.cfg and in there you can put host definitions and service definitions for all servers. Etc. But don’t forget to include those files in nagios.cfg as configuration files. The nice thing about Nagios is that you can make your configuration files in a way you want. Those preinstalled with Nagios are just an example.

I have successfully installed the nagios, however i am having diffiuculties to configure hosts.cfg files. What i need is just to check two windows machine for ping services. Alghouth I created contacts, contacts group, hosts, hostgroup and services in /etc/nagios. Can any one have some template so I can manipulate ?

being completely new means my question might be rather simple.

You have a pretty nice explanation of how to define everything in the official documantation on nagios web site. If you have any errors showing when you try to run nagios, you could post them here so we could have better insight in what is troubling you…

Just compare your configurations to the ones in documentation pages and search for the differences, another thing is to check if you have defined paths to configuration files in your nagios.cfg in a proper way.