Enter data to PHP script or SH in Nagios
Posted: Mon Apr 27, 2015 10:44 am
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
<?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