Page 2 of 2

Re: Exec plugin in nagios logserver

Posted: Thu Aug 24, 2017 10:12 am
by scottwilkerson
saleemthupsee wrote:i have verified once more the execution of the exec command by substituting the command echo to a text file. the parameters passed on the script through fields i.e %{fieldname} are not replaced by their field contents. i only have the output %{fieldname} in plain text in the text file instead of the contents of the fieldname being replaced in text file.

Anything wrong in my syntax. I checked through logstash 1.5 doc. to use %{fieldname} to gather the variables. the example is

command => "iptables -A INPUT -s %{clientip} -j DROP"

mine is :

exec {
command => "/usr/local/nagioslogserver/scripts/send_nrdp.sh -su http://192.168.97.2/nrdp -t ######## -H localhost -s %{channel_name} -S %{sh_status} -o testfromlogserver"


}
This is completely different than the command you posted before.

Is is possible for us to work one problem at a time?

to start with, I think you have an error in the command, this

Code: Select all

-su http://192.168.97.2/nrdp 
should be this

Code: Select all

-u http://192.168.97.2/nrdp 
The we need to be sure that %{sh_status} produces an integer

Re: Exec plugin in nagios logserver

Posted: Fri Aug 25, 2017 8:05 am
by saleemthupsee
attached is the log file requested.

Re: Exec plugin in nagios logserver

Posted: Fri Aug 25, 2017 9:04 am
by scottwilkerson
saleemthupsee wrote:attached is the log file requested.
So there is no failure reference in the logs, can you address the question I had in the post above?
https://support.nagios.com/forum/viewto ... 10#p230660

Re: Exec plugin in nagios logserver

Posted: Wed Sep 20, 2017 2:41 am
by saleemthupsee
hello Scott, i have resolved this using curl to update the passive status in NagiosXI instead of using the send_nrdp.sh to update the status.

cheers,
Saleem

PS: this ticket can be closed as well !

Re: Exec plugin in nagios logserver

Posted: Wed Sep 20, 2017 9:22 am
by kyang
Thanks for telling us! I'll be closing this forum as resolved if you have more questions feel free to create another forum topic.

Thank you for using the Nagios Support Forums.