script execution

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
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

script execution

Post by vinothsethuram »

Hi,

I wrote shell script which is using chck_http .How to execute that shell script using nagios i.e in command configuration. what output will be shown in nagios webUI?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: script execution

Post by sreinhardt »

Is this related to your json thread? If so please continue posting in there, so we know it is the same issue. If not, let us know and we can try to help out.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: script execution

Post by vinothsethuram »

No, its not related to JSON thread.. I have script, need to execute this script as one of the service for which I need to define in command/service configuration.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: script execution

Post by sreinhardt »

OK, can you give us an example of how you would run the command from the command line please.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: script execution

Post by vinothsethuram »

I would like to run this command ./tmp/script.sh
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: script execution

Post by slansing »

I think sreinhardt is asking if you can run the script and show the output you are returning, and what you are expecting to return.
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: script execution

Post by vinothsethuram »

No its not wokring for me.

if I use ./tmp/script.sh in command line its wokring fine. I want to execute the same line using nagios command and service configuration.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: script execution

Post by lmiltchev »

if I use ./tmp/script.sh in command line its working fine.
Can you show us an example?
Be sure to check out our Knowledgebase for helpful articles and solutions!
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: script execution

Post by vinothsethuram »

This is the example

./tmp/script.sh
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: script execution

Post by scottwilkerson »

can you show the output from running the following commands

Code: Select all

pwd
ls -la ./tmp/script.sh
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked