Error with Web Interface


I am getting this error:
Error: Could not open CGI config file ‘/usr/local/nagios/etc/cgi.cfg’ for reading!

I found that others did this and it worked:

I didn’t help me. I am on fedora core 3. PLease help


First thing you do in such cases is checking the proviliges on the files. If you’re new to nagios and trying to run it perhaps you made a mistake during the instalation proces. If you’re instaling nagios as a different user, files will be owned by you not nagios - veryfie priviliges on the files.

The second idea I get is to check if nagios and www (apache) user are in the same group because www user is trying to read cgi file.


10062769 8 drwxrwxr-x 2 nagios nagios 4096 Apr 27 16:58 bin
10063048 8 drwxrwxr-x 2 nagios nagios 4096 Apr 27 16:58 etc
10063053 8 drwxr-sr-x 2 nagios nagios 4096 Apr 27 15:56 libexec
10062770 8 drwxrwxr-x 2 nagios nagios 4096 Apr 27 16:59 sbin
10062773 8 drwxrwxr-x 9 nagios nagios 4096 Apr 27 16:43 share
10063051 8 drwxrwxr-x 3 nagios nagios 4096 Apr 27 15:52 var

Both the nagios and apache are apart of the same groups.
Edited Thu Apr 28 2005, 08:58AM ]


I am getting close. I get this error when I try to run the program

Error: Invalid hostgroup object directive ‘contact_group’.
Error: Could not add object property in file ‘/usr/local/nagios/etc/hostgroups.cfg’ on line 4.


per the docs, "define hostgroup{
hostgroup_name hostgroup_name
alias alias
contact_groups contact_groups
members members
} "
I see no directive called “contact_group”

Perhaps you have made a typo. When in doubt, check the docs.


Yep it was a typo…It is working now except for the mail notifications. I am using qmail. Is this the problem? Is there a workaround


hostgroup must look like this —>

define hostgroup{
hostgroup_name name
alias nam
contact_groups name/that/u/put/in/contact.cfg
members host/that/are/u/want/in/this/group

contactgroup.cfg must look like this—>

define contactgroup{
contactgroup_name name
alias name
members /members/that/are/in/contacts.cfg

and finally the contacts.cfg file—>

define contact{
contact_name monitor
alias monitor
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email youremailid

also make sure to follow this simple rules ---->

1.Verify that all contacts are a member of at least one contact group.
2.Verify that all contacts specified in each contact group are valid.
3.Verify that all hosts are a member of at least one host group.
4.Verify that all hosts specified in each host group are valid.
5.Verify that all hosts have at least one service associated with them.
6.Verify that all commands used in service and host checks are valid.
7.Verify that all commands used in service and host event handlers are valid.
8.Verify that all commands used in contact service and host notifications are valid.
9Verify that all notification time periods specified for services, hosts, and contact are valid.
10.Verify that all service check time periods specified for services are valid


try sending a mail by hand, using the syntax found in checkcommands.cfg or misccommands.cfg for the send-by-email command. if you find that fails, perhaps you can edit the command to use your qmail instead of “mail” very easily.