Nagios 4.3.1 not accepting single quote '
Nagios 4.3.1 not accepting single quote '
Hello All ,
I tried upgrading the nagios core from 3.5.1 to 4.3.1 in my production centos server . Nagios 4.3.1 is not accepting the single quote ' in my services.cfg whic was working fine with 3.5.1 .
For example : check_nsc_counter-graph!'\\LogicalDisk(R:)\\Avg. Disk Queue Length' this was the chack command directive defined in services.cfg file of 3.5.1 but after upgrading its turning to CRITICAL .
Please help me fix this issue
I tried upgrading the nagios core from 3.5.1 to 4.3.1 in my production centos server . Nagios 4.3.1 is not accepting the single quote ' in my services.cfg whic was working fine with 3.5.1 .
For example : check_nsc_counter-graph!'\\LogicalDisk(R:)\\Avg. Disk Queue Length' this was the chack command directive defined in services.cfg file of 3.5.1 but after upgrading its turning to CRITICAL .
Please help me fix this issue
Re: Nagios 4.3.1 not accepting single quote '
Can you share the full service definition that is returning CRITICAL, as well as the command definition for check_nsc_counter-graph?
Can you also share the full output of whatever plugin is associated with the check_nsc_counter-graph command executed from the CLI? Does executing the plugin from the CLI also return CRITICAL?
If the plugin associated with the check_nsc_counter-graph command is not a standard nagios plugin, can you also share a copy of the plugin or tell us where you found it?
Can you also share the full output of whatever plugin is associated with the check_nsc_counter-graph command executed from the CLI? Does executing the plugin from the CLI also return CRITICAL?
If the plugin associated with the check_nsc_counter-graph command is not a standard nagios plugin, can you also share a copy of the plugin or tell us where you found it?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Nagios 4.3.1 not accepting single quote '
Also, can you post your services.cfg? It's possible there's something that isn't closed, but I'm not sure why it wouldn't have show up in 3.x.
Re: Nagios 4.3.1 not accepting single quote '
Thank you taking this case .
I would like to give you more info . i have two instance one with 3.5.1 and other with 4.3.1 . SAME DEFANITION .. works fine with 3.5.1 and its giving critical error with 4.3.1 .
services.cfg
}
[/code]
ERROR Infor in 4.3.1
Perfect output at 3.5.1(working fine)
check command defanintion (common for both the versions)
TROUBLESHOOTINGS We tried
we changed to
steps 1) double quote replaced with single quote
2) $$ replaced with \$$
the aboved steps rectified the issue .
But its really very tough to change all the single quote with double quote in my nagios server cfg files . Please help me find a way to make single quote works as it workes in 3.5.1
I would like to give you more info . i have two instance one with 3.5.1 and other with 4.3.1 . SAME DEFANITION .. works fine with 3.5.1 and its giving critical error with 4.3.1 .
services.cfg
Code: Select all
define service{
use windows-counter-graph
host_name HOST1
service_description COUNTER-LogicalDisk_D_Avg_Disk_sec_Write
contact_groups GMC
check_command check_nsc_counter-graph!'\\LogicalDisk(D:)\\Avg. Disk sec/Write'
}
define service{
use generic-counter-graph-only-sql
host_name HOST1
service_description COUNTER-MSSQL_NEXIM:Transactions-Transactions
contact_groups GMC
[code]check_command check_nsc_counter-graph!'\\MSSQL$$NEXIM:Transactions\\Transactions'
[/code]
ERROR Infor in 4.3.1
Code: Select all
CRIT: Counter not found: \LogicalDisk(D:)\Avg. Disk sec/Write: -2147481648: Unable to connect to the specified computer or the computer is offline.
Code: Select all
OK: LogicalDisk(D:)Avg. Disk sec/Write: 0
check command defanintion (common for both the versions)
Code: Select all
define command{
command_name check_nsc_counter-graph
command_line $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p 56660 -c checkcounter -a $ARG1$ ShowAll
}
Code: Select all
check_nsc_counter-graph!'\\MSSQL$$NEXIM:Transactions\\Transactions'
Code: Select all
check_nsc_counter-graph!"\\MSSQL\$$NEXIM:Transactions\\Transactions"
2) $$ replaced with \$$
the aboved steps rectified the issue .
But its really very tough to change all the single quote with double quote in my nagios server cfg files . Please help me find a way to make single quote works as it workes in 3.5.1
Re: Nagios 4.3.1 not accepting single quote '
Can you run the following commands as root on both the Core 3 and the Core 4 servers and post the output?
Replace xxx.xxx.xxx.xxx with the IP address of you remote host.
And post the nagios.cfg files from both servers as well?
Replace xxx.xxx.xxx.xxx with the IP address of you remote host.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -V
/usr/local/nagios/libexec/check_nrpe -u -H xxx.xxx.xxx.xxx -p 56660 -c checkcounter -a '\\LogicalDisk(D:)\\Avg. Disk sec/Write' ShowAll
/usr/local/nagios/libexec/check_nrpe -u -H xxx.xxx.xxx.xxx -p 56660 -c checkcounter -a '\LogicalDisk(D:)\Avg. Disk sec/Write' ShowAll
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios 4.3.1 not accepting single quote '
PRODUCTION 3.5.1 OUTPUTs
TEST server 4.3.1 output
Code: Select all
# /usr/local/nagios/libexec/check_nrpe -V
/usr/local/nagios/libexec/check_nrpe: invalid option -- 'V'
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.12
Last Modified: 03-10-2008
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
Code: Select all
# /usr/local/nagios/libexec/check_nrpe -u -H 10.165.7.56 -p 56660 -c checkcounter -a '\\LogicalDisk(D:)\\Avg. Disk sec/Write' ShowAll
CRIT: Counter not found: \\LogicalDisk(D:)\\Avg. Disk sec/Write: -2147481648: Unable to connect to the specified computer or the computer is offline.
#/usr/local/nagios/libexec/check_nrpe -u -H 10.165.7.56 -p 56660 -c checkcounter -a '\LogicalDisk(D:)\Avg. Disk sec/Write' ShowAll
OK: \LogicalDisk(D:)\Avg. Disk sec/Write: 0|'\LogicalDisk(D:)\Avg. Disk sec/Write'=0
Code: Select all
/usr/local/nagios/libexec/check_nrpe -V
/usr/local/nagios/libexec/check_nrpe: invalid option -- 'V'
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.12
Last Modified: 03-10-2008
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
Code: Select all
/usr/local/nagios/libexec/check_nrpe -u -H 10.165.7.56 -p 56660 -c checkcounter -a '\\LogicalDisk(D:)\\Avg. Disk sec/Write' ShowAll
CRIT: Counter not found: \\LogicalDisk(D:)\\Avg. Disk sec/Write: -2147481648: Unable to connect to the specified computer or the computer is offline.
/usr/local/nagios/libexec/check_nrpe -u -H 10.165.7.56 -p 56660 -c checkcounter -a '\LogicalDisk(D:)\Avg. Disk sec/Write' ShowAll
OK: \LogicalDisk(D:)\Avg. Disk sec/Write: 0|'\LogicalDisk(D:)\Avg. Disk sec/Write'=0
- Attachments
-
nagios_PROD_3.5.1.cfg
- production nagios.cfg
- (43.94 KiB) Downloaded 585 times
-
nagios.cfg_TEST_4.3.1.cfg
- test nagios.cfg
- (46.85 KiB) Downloaded 440 times
Re: Nagios 4.3.1 not accepting single quote '
Do the name of the counters on the 3.5.1 server have double back slashes in them?
The single quote seems to work the same on both systems from the command line.
Normally, when you use a single quote, you do not have to use the extra escaping in the object names.
The single quote seems to work the same on both systems from the command line.
Normally, when you use a single quote, you do not have to use the extra escaping in the object names.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios 4.3.1 not accepting single quote '
Yes . config files have double slashes . So you mean to say that its wrong config with 3.5.1 and it was wroking with wrong config .?
Re: Nagios 4.3.1 not accepting single quote '
I was just asking if the commands defined in the config files had double slashes or not.
Running the command from the command line with double slashes failed on the 3.5.1 system as well as the new one and I was just curious if the commands had the double slashes in them.
I didn't find anything in the change log for core 4.x.x that states the behavior change for the slashes in the commands but there could of been a change that is affecting the command definitions.
You may want to post a bug fix at the following link.
https://github.com/NagiosEnterprises/nagioscore/issues
Running the command from the command line with double slashes failed on the 3.5.1 system as well as the new one and I was just curious if the commands had the double slashes in them.
I didn't find anything in the change log for core 4.x.x that states the behavior change for the slashes in the commands but there could of been a change that is affecting the command definitions.
You may want to post a bug fix at the following link.
https://github.com/NagiosEnterprises/nagioscore/issues
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios 4.3.1 not accepting single quote '
just i would like to narrow down the issue .
Command line execution are same and fine in both the versions .
while giving configuration in services.cfg file where double slash and double dollor are used with single quote in 3.5.1
But in 4.3.1 we need to use double quote with double slash and double dollor instead of single quote .
since is a centos server , \\ while passing from services.cfg to check command (command line) automatically one slash will be removed .
my issue is why ' need to be replaced with " in services.cfg .
Command line execution are same and fine in both the versions .
while giving configuration in services.cfg file where double slash and double dollor are used with single quote in 3.5.1
But in 4.3.1 we need to use double quote with double slash and double dollor instead of single quote .
since is a centos server , \\ while passing from services.cfg to check command (command line) automatically one slash will be removed .
my issue is why ' need to be replaced with " in services.cfg .