added the new option 'user_agent_id' which is used to define the string to identify Monitorix agent in the HTTP requests

This commit is contained in:
Jordi Sanfeliu 2016-03-17 09:48:38 +01:00
parent 78577b6e6e
commit 77f750362b
10 changed files with 12 additions and 0 deletions

View File

@ -17,6 +17,9 @@ N.N.N - DD-MMM-2015
- Added name substring match in 'process.pm'. [#136] - Added name substring match in 'process.pm'. [#136]
- Added the new option 'enable_hourly_view' which enables the ability to select - Added the new option 'enable_hourly_view' which enables the ability to select
the hourly view in the main page. the hourly view in the main page.
- Added the new option 'user_agent_id' which is used to define the string to
identify Monitorix agent in the HTTP requests. That value is sent as the
"User-Agent" header.
- Fixed in 'libvirt.pm' limiting to 100 all CPU values greater than 100. - Fixed in 'libvirt.pm' limiting to 100 all CPU values greater than 100.
- Fixed in 'libvirt.pm' to hide empty groups. - Fixed in 'libvirt.pm' to hide empty groups.
(thanks to Pavel Bauer, pbauer AT algotech.cz for pointing this out) (thanks to Pavel Bauer, pbauer AT algotech.cz for pointing this out)

View File

@ -616,6 +616,7 @@ sub apache_update {
if lc($config->{accept_selfsigned_certs}) eq "y"; if lc($config->{accept_selfsigned_certs}) eq "y";
my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $url)); my $response = $ua->request(HTTP::Request->new('GET', $url));
if(!$response->is_success) { if(!$response->is_success) {

View File

@ -303,6 +303,7 @@ sub bind_update {
if lc($config->{accept_selfsigned_certs}) eq "y"; if lc($config->{accept_selfsigned_certs}) eq "y";
my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $l)); my $response = $ua->request(HTTP::Request->new('GET', $l));
my $data = XMLin($response->content); my $data = XMLin($response->content);
my $value; my $value;

View File

@ -95,6 +95,7 @@ EOF
# generate the graphs and get the html source # generate the graphs and get the html source
my $url = $prefix . $base_cgi . "/monitorix.cgi?mode=localhost&graph=_$g&when=$when&color=white"; my $url = $prefix . $base_cgi . "/monitorix.cgi?mode=localhost&graph=_$g&when=$when&color=white";
my $ua = LWP::UserAgent->new(timeout => 120, $ssl); my $ua = LWP::UserAgent->new(timeout => 120, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $url)); my $response = $ua->request(HTTP::Request->new('GET', $url));

View File

@ -172,6 +172,7 @@ sub icecast_update {
if lc($config->{accept_selfsigned_certs}) eq "y"; if lc($config->{accept_selfsigned_certs}) eq "y";
my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $ils)); my $response = $ua->request(HTTP::Request->new('GET', $ils));
my $data = $response->content; my $data = $response->content;

View File

@ -151,6 +151,7 @@ sub lighttpd_update {
if lc($config->{accept_selfsigned_certs}) eq "y"; if lc($config->{accept_selfsigned_certs}) eq "y";
my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $url)); my $response = $ua->request(HTTP::Request->new('GET', $url));
if(!$response->is_success) { if(!$response->is_success) {

View File

@ -158,6 +158,7 @@ sub nginx_update {
$url = "http://127.0.0.1:" . $nginx->{port} . "/nginx_status"; $url = "http://127.0.0.1:" . $nginx->{port} . "/nginx_status";
} }
my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $url)); my $response = $ua->request(HTTP::Request->new('GET', $url));
my $rrdata = "N"; my $rrdata = "N";

View File

@ -197,6 +197,7 @@ sub pagespeed_update {
if lc($config->{accept_selfsigned_certs}) eq "y"; if lc($config->{accept_selfsigned_certs}) eq "y";
my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $url)); my $response = $ua->request(HTTP::Request->new('GET', $url));
if(!$response->is_success) { if(!$response->is_success) {

View File

@ -151,6 +151,7 @@ sub phpapc_update {
if lc($config->{accept_selfsigned_certs}) eq "y"; if lc($config->{accept_selfsigned_certs}) eq "y";
my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $pls)); my $response = $ua->request(HTTP::Request->new('GET', $pls));
my $data = $response->content; my $data = $response->content;

View File

@ -369,6 +369,7 @@ sub traffacct_sendreports {
if lc($config->{accept_selfsigned_certs}) eq "y"; if lc($config->{accept_selfsigned_certs}) eq "y";
my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
$ua->request(HTTP::Request->new('GET', $url)); $ua->request(HTTP::Request->new('GET', $url));
$url = $traffacct->{reports}->{url_prefix} . $base_url . "/" . $imgs_dir . "traffacct" . $n . ".1month.$imgfmt_lc"; $url = $traffacct->{reports}->{url_prefix} . $base_url . "/" . $imgs_dir . "traffacct" . $n . ".1month.$imgfmt_lc";