CACTI VIA PROXY

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Maher457
Cacti User
Posts: 54
Joined: Thu Jul 29, 2010 3:07 am
Location: Paris France

Post by Maher457 »

I REBOOT IT IT SOLVES THE PROBLEM BUT WHT SHOULD I DO NOW TO SOLVE THE SCRIPT PROBLEM?
Maher457
Cacti User
Posts: 54
Joined: Thu Jul 29, 2010 3:07 am
Location: Paris France

Post by Maher457 »

i found the origin of the problem when i do a realtime graph for the graph cacti bags only for the http proxy for the other it works normally:s
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

So is the script working now, or are you referring to your network slowness ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Maher457
Cacti User
Posts: 54
Joined: Thu Jul 29, 2010 3:07 am
Location: Paris France

Post by Maher457 »

NO THE SCRIPT STILL NOT WORKING
the slowliness is due when i do a realtime view of the graph of http via proxy cacti become very slow!!
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

You may miss a package. Try installing the following package and run the script from the command line again:

Code: Select all

yum install perl-Authen-NTLM
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Maher457
Cacti User
Posts: 54
Joined: Thu Jul 29, 2010 3:07 am
Location: Paris France

Post by Maher457 »

got this message:

Setting up Install Process
Setting up repositories
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
centosplus 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
No Match for argument: perl-Authen-NTLM
Nothing to do
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

nice, ok

it's probably easier then to go for the PHP variant:

copy the code into a local php file, change the username and password and call that one from the CLI

Code: Select all

<?php
$proxyServer=$argv[1];
$proxyPort=$argv[2];
$url=$argv[3];
$proxyUsername="DOMAIN\\Username";
$proxyPassword="Password";

$startTime = microtime();

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt($ch, CURLOPT_PROXY, "$proxyServer:$proxyPort");
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "$proxyUsername:$proxyPassword");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$result = curl_exec($ch);
$info = curl_getinfo($ch);

if ( $result === false || $info['http_code'] != 200) {
        echo "U";
}
else {
        echo microtime() - $startTime;
}
curl_close($ch);
?>
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Maher457
Cacti User
Posts: 54
Joined: Thu Jul 29, 2010 3:07 am
Location: Paris France

Post by Maher457 »

what is the PHP variant?please can u tell me where i have to put the php code exactly?and how can i run it and have a graph in cacti?
thanks
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

put it as a script to the scripts dir ad jsut do the same as you did for the perl script ?

Did you at least try it on the CLI if that one works with your NTLM proxy ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Maher457
Cacti User
Posts: 54
Joined: Thu Jul 29, 2010 3:07 am
Location: Paris France

Post by Maher457 »

the perl script when i have run it on CLI it printed just 'U'
so i have to create a proxiedHttpCheck.php with the new code and do the same for creating a graph template as before?
Maher457
Cacti User
Posts: 54
Joined: Thu Jul 29, 2010 3:07 am
Location: Paris France

Post by Maher457 »

i run the new php script in the CLI i got after one minute of runing 'U' again!
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

yes.

What does the php script print then ? it uses the exactly same parameters
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

Maher457 wrote:i run the new php script in the CLI i got after one minute of runing 'U' again!
then I need to give up. It's working just fine with my proxy environment ...
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Maher457
Cacti User
Posts: 54
Joined: Thu Jul 29, 2010 3:07 am
Location: Paris France

Post by Maher457 »

in the CLI the php script print 'U'
is that normal?
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

no, it should provide a number. U just means no data to return, either as it did not authenticate you, or the url did return an error
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests