Enter data to PHP script or SH in Nagios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
monitoreo1
Posts: 124
Joined: Wed Feb 18, 2015 10:41 am

Enter data to PHP script or SH in Nagios

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Enter data to PHP script or SH in Nagios

Post by tmcdonald »

Do you have a specific question or are you just sharing information?
Former Nagios employee
monitoreo1
Posts: 124
Joined: Wed Feb 18, 2015 10:41 am

Re: Enter data to PHP script or SH in Nagios

Post 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
monitoreo1
Posts: 124
Joined: Wed Feb 18, 2015 10:41 am

Re: Enter data to PHP script or SH in Nagios

Post by monitoreo1 »

You can close the topic.
Thanks
Locked