Config file not working NULL value

Hi I wrote a php script that will programatically generate configuration files for nagios, i’m having a problem with the config files im generating. Even though they look absolutely identical to the ‘sample’ ones (i havent gotten to the point yet of modifying them…) when I execute nagios the logfile reports:

[1125083502] Error in configuration file ‘/usr/local/nagios/etc/nagios.cfg’ - Line 1 (NULL value)

this is the first few lines of my configuration:

define contact{
contact_name drew
alias drew
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email [email protected]
}

Thanks,
-Drew

The error was about the nagios.cfg file on line 1, but you posted your contacts.cfg file? OK, well… ummm…

Well I thought the config files were merged in the new version of nagios? I just followed the exact same guidelines as the bigger.cfg-example file?

Am i completely clueless? in the older nagios everything was split into multi files…

OK, so you have everything in one file called nagios.cfg and what you pasted was the first few lines, including line #1, which is causing the error right? If so, then I have no clue, since it looks fine.

Right, I figured that error out. Thanks…

I had one other question. Nagios insists on looking for my plugins (which are in /usr/local/nagios/libexec) in /… when i start it up it immediately says /check_udp file not found, if i copy the files to / it works fine, however i’d like to keep the plugins in a directory.

Thanks,
-Drew

It would be most helpful, to anyone reading this forum, if you would explain how you fixed your problem.

$USER1$=/usr/local/nagios/libexec is that what you have in your nagios.cfg file?

Since the checkcommands are defined like this:
define command{
command_name check_tcp
command_line $USER1$/check_tcp