Issue in starting nagios daemon while configuring Filecount

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jyoti22
Posts: 254
Joined: Mon Mar 23, 2015 4:50 am

Issue in starting nagios daemon while configuring Filecount

Post by jyoti22 »

Hi Team,

To perform file count monitoring, I have copied check_files on client machine under path C:\Program Files\NSClient++\scripts
and updated nsclient.ini file as

Code: Select all

[/settings/NRPE/server]
NRPEServer = 1
allow arguments = 1
allow nasty meta chars = 1
port = 5666
use SSL = 1

[/settings/external scripts/wrappings]
; Undocumented key
CheckExternalScripts = 1
check_files = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper check_files.vbs %SCRIPT% %ARGS%
On nagios box I created service as below

Code: Select all

define service {
        host_name                       DMSAZTWDAS01
        service_description             Number of files on folder FTP
        check_command                   check_nrpe!check_files!/path:"F:\\FTP_Data" /searchdepth:1 /selage:ignore /warning:20 /critical:25
        servicegroups                   SPS_WIN_SERVICE_MON
        initial_state                   u
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    24x7
        notification_period             24x7
        notification_options            w,c,r,
        register                        1
        }
Now when I run the "/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg" I get error in config

Code: Select all

Nagios Core 4.3.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-05-09
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: Service check command 'check_nrpe!check_files!/path:"F:\\FTP_Data" /searchdepth:1 /selage:ignore /warning:20 /critical:25' specified in service 'Number of files on folder FTP' for host 'DMSAZTWDAS01' not defined anywhere!
        Checked 93 services.
        Checked 23 hosts.
        Checked 4 host groups.
        Checked 2 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 25 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 23 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   1

***> One or more problems was encountered while running the pre-flight check...

     Check your configuration file(s) to ensure that they contain valid
     directives and data definitions.  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.

Error while restarting nagios

[root@DMSAZPLMON01 system]# service nagios start
Starting nagios (via systemctl): Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.
[FAILED]
[root@DMSAZPLMON01 system]#

Can you please help e how can I configure filecount monitoring. Thanks a lot.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Issue in starting nagios daemon while configuring Fileco

Post by tgriep »

It looks like the check_nrpe command is not defined in the commands.cfg file and when nagios loads and it cannot find it, it would cause that error so if it is not defined, you would have to create the command.
I have included an example of the check_nrpe command if you need it.

Code: Select all

define command {
       command_name                  		check_nrpe
       command_line                  		$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
If this is where you downloaded the check_files.vbs script
https://exchange.nagios.org/directory/P ... nt/details
You may want to look at it for the examples in the file and adjust your server to match.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jyoti22
Posts: 254
Joined: Mon Mar 23, 2015 4:50 am

Re: Issue in starting nagios daemon while configuring Fileco

Post by jyoti22 »

check_nrpe command is already mentioned in the commands.cfg but still I get the error. And I have given command syntax as per the vbs script
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Issue in starting nagios daemon while configuring Fileco

Post by dwhitfield »

Can you attach or PM your commands.cfg? You may have a typo. It would be strange if it were a permissions issue and that was the only error, but what are the permissions on the commands.cfg? If you PM the file, make sure you update this thread so it comes back up on our support dashboard.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Issue in starting nagios daemon while configuring Fileco

Post by lmiltchev »

You have the following:

Code: Select all

check_files = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper check_files.vbs %SCRIPT% %ARGS%
under the [/settings/external scripts/wrappings] section. This doesn't look right...

Here's what I have:

Code: Select all

[/settings/external scripts/wrappings]
...
; VISUAL BASIC WRAPPING - 
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%

Code: Select all

[/settings/external scripts/scripts]
...
check_files = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs check_files.vbs $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$ $ARG12$ $ARG13$ $ARG14$
Can you show us how the "check_nrpe" is defined on the nagios server?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked