<div dir="ltr">Solved!!!!<div><br></div><div>In the past : check_command check_birdseye_bgp_session!$<font color="#ff0000">_SERVICEAPIURL!$_</font>SERVICEPROTOCOL</div><div><br></div><div>Now : check_command check_birdseye_bgp_session!$_<font color="#ff0000">SERVICEAPI_URL!$</font>_SERVICEPROTOCOL</div><div><br></div><div><font face="comic sans ms, sans-serif" size="4"><a href="https://imgur.com/a/oJkAQoM">https://imgur.com/a/oJkAQoM</a></font><br></div><div><br></div><div>Thanks</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 21, 2020 at 2:19 PM Basil Elbalaawi <<a href="mailto:saifbasilyazan@gmail.com">saifbasilyazan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div><br></div><div>root@nagios:/usr/local/nagios-plugins-other# dpkg -l | grep php<br>ii libapache2-mod-php 2:7.4+75 all server-side, HTML-embedded scripting language (Apache 2 module) (default)<br>ii libapache2-mod-php7.4 7.4.3-4ubuntu2.4 amd64 server-side, HTML-embedded scripting language (Apache 2 module)<br>ii php 2:7.4+75 all server-side, HTML-embedded scripting language (default)<br>ii php-common 2:75 all Common files for PHP packages<br>ii php-curl 2:7.4+75 all CURL module for PHP [default]<br>ii php7.4 7.4.3-4ubuntu2.4 all server-side, HTML-embedded scripting language (metapackage)<br>ii php7.4-cli 7.4.3-4ubuntu2.4 amd64 command-line interpreter for the PHP scripting language<br>ii php7.4-common 7.4.3-4ubuntu2.4 amd64 documentation, examples and common module for PHP<br>ii php7.4-curl 7.4.3-4ubuntu2.4 amd64 CURL module for PHP<br>ii php7.4-json 7.4.3-4ubuntu2.4 amd64 JSON module for PHP<br>ii php7.4-opcache 7.4.3-4ubuntu2.4 amd64 Zend OpCache module for PHP<br>ii php7.4-readline 7.4.3-4ubuntu2.4 amd64 readline module for PHP<br>root@nagios:/usr/local/nagios-plugins-other#<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 20, 2020 at 11:13 PM Nick Hilliard <<a href="mailto:nick@foobar.org" target="_blank">nick@foobar.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Basil Elbalaawi wrote on 20/10/2020 19:15:<br>
> root@nagios:/usr/local/nagios-plugins-other# <br>
> ./nagios-check-birdseye-bgp-sessions.php -a <br>
> <a href="http://rs1-lan1-ipv4.ps-ix.ps/api" rel="noreferrer" target="_blank">http://rs1-lan1-ipv4.ps-ix.ps/api</a> -p pb_0002_as20719<br>
> OK:<br>
> <br>
> you can see the Nagios output :<br>
> <br>
> <a href="https://imgur.com/a/bXnHqnc" rel="noreferrer" target="_blank">https://imgur.com/a/bXnHqnc</a><br>
<br>
The "UNKNOWN: You must set a valid API host" error is generated when <br>
curl_init() fails.<br>
<br>
This seems to work from the command line, but not when the script is <br>
called from nagios, which is strange.<br>
<br>
Do you have multiple instances of PHP installed on this server? What is <br>
the output of "dpkg -l | grep php"?<br>
<br>
Nick<br>
</blockquote></div>
</blockquote></div>