Reading configuration data…
Error: Unexpected token or statement in file ‘/usr/local/nagios/etc/checkcommands.cfg’ on line 49.
***> One or more problems was encountered while processing the config files…
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation on the main and host config files, as well as the
'Whats New' section to find out what has changed.
===============================================
Anyone has any ideas what went wrong? Because my nagios installation is a new setup and not an upgrade. Any assistance will be greatly appreciated.
Can you post your /usr/local/nagios/etc/checkcommands.cfg file. Usually this is caused by typos or syntax errors, or trying to reference something (like a plugin or host/service) that does not exist or is inaccessable.
Check to make sure that the appropriate plugin exists in /usr/local/nagios/libexec. Check the syntax of the command that is flagging the error. You may want to su to the nagios user and ensure that the user can read and exicute the required files.
Hope this helps and good luck with your implementation.
You have also made me realised that although my installation was successful, my Nagios folder does not comes with etc (I created the etc folder manually) and libexec folder (Even I followed the manual closely :x )
Anyway here’s my checkcommands.cfg (I have copied all samples files from the sample-config folder to the manually created etc folder)
The information you sent looks fine, but you are still getting the message: Error: Unexpected token or statement in file ‘/usr/local/nagios/etc/checkcommands.cfg’ on line 49
if so this is a syntax error in the checkcommands.cfg. Look at the checkcommand on line 49 in your check commands file somewhere in that checkcommand is an error. Nagios is pretty picky in regards to syntax. I was looking through the defauld installation and I could run the nagios process from these. My commands look much different than the ones you posted:
Also I remember having problems when there were blank spaces on lines. I tried to comment stuff out but left spaces in front of the # and recieved syntax errors.
I would suggest to setup small test commands/services/hosts so you can have minimal problems getting the initial app to work and then master it. You will notice that nagios configuration is repetitive and once it works once, you will be able to add on to it easily and identify problems as you go.
etc missing: did you run “make install-config”?
libexec missing: did the configure part of the plugins install recognize nagios? it hould install the plugins to the agios libexec directory on make install…
Check you don’t have some unwanted new lines hanging around. possibly copying the files you changed something? By the problems you already had it looks like this install isn’t going really well, i’d recommend redoing it from scratch, at least you’d be sure you avoid hitting some misterious permission problems further on.
after make, make install, check the output from make, it should give you all possible alternatives. there should be the init file installation and the config files and some more.