Pass "!" is a service argument

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kmarinov
Posts: 5
Joined: Fri Oct 20, 2017 5:19 am

Pass "!" is a service argument

Post by kmarinov »

Hi all

Happy to join the forum!

I'm currently adding a new monitoring for 3rd party Windows service and getting to followin error:
(No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'

I'm using Nagios XI -> Service Management and when I add the name for example: "Name! Test" and save it - when i get back into the settings of this service i see as follow:
Name
Test


without "!" and on two lines.

How can I pass "!"? Probably that is the reason of the error.

Thank you in advance
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Pass "!" is a service argument

Post by cdienger »

! is used as an argument seperator in Nagios. Try using a \ to escape it first. https://support.nagios.com/kb/article/n ... cters.html has more information on this.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kmarinov
Posts: 5
Joined: Fri Oct 20, 2017 5:19 am

Re: Pass "!" is a service argument

Post by kmarinov »

Thank you but I still cannot pass it with \ in front of !. Any other suggestions?

I'm using check_nsc_nt plugin
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Pass "!" is a service argument

Post by cdienger »

Can you clarify where it isn't working with a screenshot of it failing? It's possible that the test button will no longer work but it is still able to execute as scheduled and will display content on the dashboard.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kmarinov
Posts: 5
Joined: Fri Oct 20, 2017 5:19 am

Re: Pass "!" is a service argument

Post by kmarinov »

The one from the left is before I save (that is the real name of the service and how I want to looks like) and the one from right is after I click Save and get back into the service options.
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Pass "!" is a service argument

Post by npolovenko »

@kmarinov, What version of XI are you running? Can you try to paste "Act\! Scheduler" as an argument to a different random command, save it and then reopen it. Would it be split over two lines or no?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kmarinov
Posts: 5
Joined: Fri Oct 20, 2017 5:19 am

Re: Pass "!" is a service argument

Post by kmarinov »

Hello,

Our version is Nagios® Core™ Version 4.0.7. I tried the same command in different config but the result is the same...
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Pass "!" is a service argument

Post by npolovenko »

@kmarinov , Can you try to use single quotes instead?
'Act! Scheduler'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Pass "!" is a service argument

Post by SteveBeauchemin »

Check this old post...
https://support.nagios.com/forum/viewto ... 95#p158633
Your solution is there.
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Pass "!" is a service argument

Post by npolovenko »

Thanks, @SteveBeauchemin!
@kmarinov, Let us know if your issue was resolved so we can close this thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked