Page 14 of 15

Re: Check Windows Processes

Posted: Mon Jul 22, 2013 11:29 am
by ofadl
i couldn't cd to

Code: Select all

 /usr/local/nagios/etc
.

Output for :

Code: Select all

grep -Ri 'check_nrpe'./*

Code: Select all

./downloads/nagios-3.2.3/t-tap/smallconfig/objects.cache:command_line check_nrpe_arg!30!check_fs_ping!/mnt/account-p,/mnt/prepro-p,/mnt/webapp-ssl,/mnt/rollout-p
./downloads/nagios-3.2.3/t-tap/smallconfig/minimal.cfg:check_nrpe_arg!30!\
./downloads/nagios-3.2.3/t/etc/no-contactgroup-error.cfg: check_ nrpe_arg!30!\
./downloads/nagios-3.2.3/t/etc/minimal.cfg:check_nrpe_arg!30!\
./downloads/nagios-3.2.3/t/var/objects.precache.expected:command_line check_nrpe_arg!30!check_fs_ping!/mnt/account-p,/mnt/prepro-p,/mnt/webapp-ssl,/mnt /rollout-p
./downloads/nagios-3.2.3/html/docs/redundancy.html:Set up a cron job on the slave host that periodically (say every minute) runs a script that checks the staus of the Nagios process on the master host (using the <i>check_nrpe</i> plugin on                                                                       the slave host and the <a href="addons.html#nrpe">nrpe daemon</a> and <i>check_nagios</i> plugin on the master host).  The script should check the return code of the <i>check_nrpe plugin</i> .  

If it returns a non-OK state, the script should send the appropriate commands to the <a href="configmain.html#command_file">external command file</a> to enable both notifications and active service checks.                                                                        If the plugin returns an OK state, the script should send commands to the external command file to disable both notifications and active checks.


Re: Check Windows Processes

Posted: Mon Jul 22, 2013 12:14 pm
by sreinhardt
How are you able to run the past couple of pages of posts if you do not have /usr/local/nagios. To quote yourself:
well thats the thing, i have two commands files, but that one that i posted i use as my main one and add definitions into it. The weird part is, when i tried to add check_nrpe into that command file, i get a error for duplicate defintion, even though i havent defind it before in that file.

Here is the other file located in /usr/local/nagios/etc/objects/commands.cfg:
The directory specified is the one used store your nagios configs. Where is this located on your system? Go to that directory and run the grep please. The downloads directory is not a proper place to store nagios configs.

Re: Check Windows Processes

Posted: Mon Jul 22, 2013 12:27 pm
by ofadl
My apoliges, i do indeed have /usr/local/nagios, but i do not go in there at all to use my nagios information.I also deleted the other commands.cfg file inside my /usr/local/nagios/etc/objects. I go into /etc/nagios3/objects and there have all my config files. I went into /etc/nagios3/objects and ran :

Code: Select all

grep -Ri 'check_nrpe' ./*
with this as output:

Code: Select all

./commands.cfg: #      command_name                             check_nrpe
./commands.cfg:  #     command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
./linux.cfg:    check_command           check_nrpe_1arg!check_mem
./windows.cfg:   #     check_command check_nrpe!run_mssql_sproc!vnadat121!Equinox!user!pass!sp_CheckCoreLastDeliveredBusHours
./windows.cfg:        check_command                   check_nrpe!check_procs_from_file!-a host.proclist.txt




Re: Check Windows Processes

Posted: Mon Jul 22, 2013 12:35 pm
by slansing
You will need to remove the "#" in front of your check_nrpe definition within the commands.cfg file located in /etc/nagios3/* this will uncomment the definitions so they can be used. Once this is done, verify the configuration as normal "the nagios3 configuration." Let us know what your checks look like after that is done.

On another note, you may need to focus on figuring some of this out on your own as we have no idea how far these non default changes go in your environment, whilst we try to support every unique install, from this forum we do not have the same outlook on your environment that you do. I'd recommend to make the changes and then try troubleshooting some more following the same methodology we have been using with you here. I'd also recommend, since you may need it in the future, to purchase a core support contract from our sales team. This would allow you to use our ticketing system, as well as allow us to remote into your system and assist when deemed necessary.

[email protected]

Re: Check Windows Processes

Posted: Mon Jul 22, 2013 12:39 pm
by ofadl
well that's the issue, if i remove the # sign, i get a duplicate definition error

Re: Check Windows Processes

Posted: Tue Jul 23, 2013 10:55 am
by lmiltchev
Can you post the error that you are getting?

Re: Check Windows Processes

Posted: Tue Jul 23, 2013 11:28 am
by ofadl
* Restarting nagios3 monitoring daemon nagios3

Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios3/commands.cfg'...
Processing object config directory '/etc/nagios-plugins/config'...
Processing object config file '/etc/nagios-plugins/config/mrtg.cfg'...
Processing object config file '/etc/nagios-plugins/config/flexlm.cfg'...
Processing object config file '/etc/nagios-plugins/config/pgsql.cfg'...
Processing object config file '/etc/nagios-plugins/config/ldap.cfg'...
Processing object config file '/etc/nagios-plugins/config/mysql.cfg'...
Processing object config file '/etc/nagios-plugins/config/snmp.cfg'...
Processing object config file '/etc/nagios-plugins/config/users.cfg'...
Processing object config file '/etc/nagios-plugins/config/dummy.cfg'...
Processing object config file '/etc/nagios-plugins/config/load.cfg'...
Processing object config file '/etc/nagios-plugins/config/http.cfg'...
Processing object config file '/etc/nagios-plugins/config/tcp_udp.cfg'...
Processing object config file '/etc/nagios-plugins/config/games.cfg'...
Processing object config file '/etc/nagios-plugins/config/mailq.cfg'...
Processing object config file '/etc/nagios-plugins/config/radius.cfg'...
Processing object config file '/etc/nagios-plugins/config/telnet.cfg'...
Processing object config file '/etc/nagios-plugins/config/nt.cfg'...
Processing object config file '/etc/nagios-plugins/config/rpc-nfs.cfg'...
Processing object config file '/etc/nagios-plugins/config/disk.cfg'...
Processing object config file '/etc/nagios-plugins/config/hppjd.cfg'...
Processing object config file '/etc/nagios-plugins/config/breeze.cfg'...
Processing object config file '/etc/nagios-plugins/config/netware.cfg'...
Processing object config file '/etc/nagios-plugins/config/ping.cfg'...
Processing object config file '/etc/nagios-plugins/config/dhcp.cfg'...
Processing object config file '/etc/nagios-plugins/config/real.cfg'...
Processing object config file '/etc/nagios-plugins/config/ntp.cfg'...
Processing object config file '/etc/nagios-plugins/config/news.cfg'...
Processing object config file '/etc/nagios-plugins/config/mail.cfg'...
Processing object config file '/etc/nagios-plugins/config/ssh.cfg'...
Processing object config file '/etc/nagios-plugins/config/fping.cfg'...
Processing object config file '/etc/nagios-plugins/config/check_nrpe.cfg'...
Processing object config file '/etc/nagios-plugins/config/disk-smb.cfg'...
Processing object config file '/etc/nagios-plugins/config/ifstatus.cfg'...
Processing object config file '/etc/nagios-plugins/config/ftp.cfg'...
Processing object config file '/etc/nagios-plugins/config/apt.cfg'...
Processing object config file '/etc/nagios-plugins/config/dns.cfg'...
Processing object config file '/etc/nagios-plugins/config/procs.cfg'...
Processing object config file '/etc/nagios3/objects/commands.cfg'...
Warning: Duplicate definition found for command 'check_nrpe' (config file '/etc/nagios3/objects/commands.cfg', starting on line 217)
Error: Could not add object property in file '/etc/nagios3/objects/commands.cfg' on line 218.
Error processing object config files!

***> 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 regarding the config files, as well as the
'Whats New' section to find out what has changed.

* errors in config!

Re: Check Windows Processes

Posted: Tue Jul 23, 2013 4:50 pm
by lmiltchev
It seems like you still have two "command.cfg" files... one - in "/etc/nagios3/commands.cfg" and another one - in "/etc/nagios3/objects/commands.cfg". I thought you deleted one of them...
...wow this is a mess. Ok so i combined them into one file and remove the other...
Try removing one of them, check paths in the main config file (nagios.cfg) and verify configuration again.

Re: Check Windows Processes

Posted: Wed Jul 24, 2013 8:52 am
by ofadl
ok, so i just removed the commands.cfg inside /etc/nagios3/commands.cfg and changed the path in the nagios.cfg folder to look like this:

Code: Select all


##############################################################################
#
# NAGIOS.CFG - Sample Main Config File for Nagios
#
#
##############################################################################


# LOG FILE
# This is the main log file where service and host events are logged
# for historical purposes.  This should be the first option specified
# in the config file!!!

log_file=/var/log/nagios3/nagios.log

# Commands definitions
cfg_file=/etc/nagios3/objects/commands.cfg

# Debian also defaults to using the check commands defined by the debian
# nagios-plugins package
cfg_dir=/usr/lib/nagios/plugins

# Debian uses by default a configuration directory where nagios3-common,
# other packages and the local admin can dump or link configuration
# files into.
#cfg_dir=/etc/nagios3/conf.d

# OBJECT CONFIGURATION FILE(S)
# These are the object configuration files in which you define hosts,
# host groups, contacts, contact groups, services, etc.
# You can split your object definitions across several config files
# if you wish (as shown below), or keep them all in a single config file.

# You can specify individual object config files as shown below:
cfg_file=/etc/nagios3/objects/commands.cfg
cfg_file=/etc/nagios3/objects/contacts.cfg
cfg_file=/etc/nagios3/objects/timeperiods.cfg
cfg_file=/etc/nagios3/objects/templates.cfg
All i did, was remove the empty commands.cfg inside /etc/nagios3/commands.cfg then changed the path inside :

# Commands definitions
from cfg_file=/etc/nagios3/commands.cfg TO cfg_file=/etc/nagios3/objects/commands.cfg

AND

# Debian also defaults to using the check commands defined by the debian
# nagios-plugins package
from cfg_file=/etc/nagios-plugins/config TO cfg_file=/usr/lib/nagios/plugins



and now im getting this error:

Code: Select all


Processing object config file '/etc/nagios3/objects/commands.cfg'...
Error: Unexpected token or statement in file '/etc/nagios3/objects/commands.cfg' on line 232.
   Error processing object config files!


***> 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 regarding the config files, as well as the
     'Whats New' section to find out what has changed.

 * errors in config!

Re: Check Windows Processes

Posted: Wed Jul 24, 2013 9:18 am
by slansing
Well... lets start.. by looking into the line that is shown in the error.


What is on line 232..?
Error: Unexpected token or statement in file '/etc/nagios3/objects/commands.cfg' on line 232