Page 1 of 1

Enter data to PHP script or SH in Nagios

Posted: Mon Apr 27, 2015 10:44 am
by monitoreo1
Enter data to PHP script or SH in Nagios

<?php
fwrite(STDOUT, "Enter your name\n"); // Output - prompt user
$name = fgets(STDIN); // Read the input
fwrite(STDOUT, "Hello $name"); // Output - Some text
exit(0); // Script ran OK
?>


OR

#!/bin/bash
echo -n "Enter the first value :"
read op1

echo -n "Enter the first value :"
read op2


Nagios version is:
Nagios XI Version : 2014R2.6
Linux version is
x86_64
Red Hat Enterprise Linux Server release 7.0 (Maipo)
Gnome

Re: Enter data to PHP script or SH in Nagios

Posted: Mon Apr 27, 2015 10:57 am
by tmcdonald
Do you have a specific question or are you just sharing information?

Re: Enter data to PHP script or SH in Nagios

Posted: Mon Apr 27, 2015 11:19 am
by monitoreo1
I have a php script that I run with action to pass a data and process it as an argument from another shell script
https://drive.google.com/file/d/0B20mP- ... sp=sharing
By submitting the information for validation it is not running
https://drive.google.com/file/d/0B20mP- ... sp=sharing

Re: Enter data to PHP script or SH in Nagios

Posted: Mon Apr 27, 2015 4:26 pm
by monitoreo1
You can close the topic.
Thanks