Skip to content

Commit

Permalink
fix 'services with : in name' problem
Browse files Browse the repository at this point in the history
(pnp4nagios has it built in, somewhere)
update release number
  • Loading branch information
Charles Lane committed Sep 29, 2022
1 parent 9427e9c commit ed897bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions includes/displayfunctions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function host_details($hostname)
$hostaction = "";
if ($ACTION_HOST != "")
{
$hostaction = sprintf("<a href=\"".$ACTION_HOST."\"><img src=\"action.gif\"></a>",$host);
$hostaction = sprintf("<a href=\"".$ACTION_HOST."\"><img src=\"action.gif\"></a>",urlencode($host));
}

$content .='
Expand Down Expand Up @@ -201,9 +201,6 @@ function hostservice_details($serviceID)
global $BASE_URL;
global $ACTION_SERVICE;




$content = '';

foreach ($status["hosts"] as $host_id => $host_status)
Expand All @@ -229,7 +226,8 @@ function hostservice_details($serviceID)
$serviceaction = "";
if ($ACTION_SERVICE != "")
{
$serviceaction = sprintf("<a href=\"".$ACTION_SERVICE."\"><img src=\"action.gif\"></a>",$host,$service);
$servdsc = str_replace(":","_",$service);
$serviceaction = sprintf("<a href=\"".$ACTION_SERVICE."\"><img src=\"action.gif\"></a>",urlencode($host),urlencode($servdsc));
}

$content .='
Expand All @@ -248,7 +246,7 @@ function hostservice_details($serviceID)
</div> <!-- end header -->
<ul data-role="listview" data-inset="false" data-theme="f" data-dividertheme="a">
<li data-role="list-divider" role="heading">Information '.$ACTION_SERVICE.'
<li data-role="list-divider" role="heading">Information '.$serviceaction.'
<div class="information rounded">
<dl>
<dt>Host: </dt><dd>'.htmlentities($host).'</dd>
Expand Down
4 changes: 2 additions & 2 deletions nagiosmobile.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# build from .tar.gz version
#
%define version 1.03
%define relnum 5
%define relnum 8
%define NVdir %{name}-%{version}

Name: nagiosmobile
Expand All @@ -13,7 +13,7 @@ License: GNU 2.0

URL: /~https://github.com/celane/nagiosmobile
#URL: http://www.nagios.com/products/nagios-mobile
Source: /~https://github.com/celane/nagiosmobile/archive/refs/tags/nagiosmobile-1.03-5.tar.gz
Source: /~https://github.com/celane/nagiosmobile/archive/refs/tags/nagiosmobile-%{version}-%{relnum}.tar.gz

BuildRequires: perl
Requires: php >= 8.0
Expand Down
2 changes: 1 addition & 1 deletion nagiosmobile_git.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%define version 1.03
%define relnum 7
%define relnum 8
%define NVdir %{name}-%{version}

Name: nagiosmobile
Expand Down

0 comments on commit ed897bc

Please sign in to comment.