Help on Script
Moderators: Developers, Moderators
Help on Script
Hello All,
I'm trying to do a cacti script and template, but cacti
returns error, but i dont have this error executing this script on console...
Someone can help me ?
debug log:
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] CMD: c:\php\php-win.exe -q D:\cacti\alvaro3.php, output: U
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] WARNING: Result from CMD not valid. Partial Result: SERVER XYZ:99.2973
ps: My apologizes for my bad english.
I'm trying to do a cacti script and template, but cacti
returns error, but i dont have this error executing this script on console...
Someone can help me ?
debug log:
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] CMD: c:\php\php-win.exe -q D:\cacti\alvaro3.php, output: U
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] WARNING: Result from CMD not valid. Partial Result: SERVER XYZ:99.2973
ps: My apologizes for my bad english.
- Attachments
-
- alvaro3.txt
- (365 Bytes) Downloaded 443 times
Reinhard,
When i execute from console, the script gimme the values like this:
SERVER 1:99.99
Attached the screenshot...
In the cacti log, i have this:
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] CMD: c:\php\php-win.exe -q D:\cacti\alvaro3.php, output: U
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] WARNING: Result from CMD not valid. Partial Result: SERVER XYZ:99.2973
Thank you,
Alvaro
When i execute from console, the script gimme the values like this:
SERVER 1:99.99
Attached the screenshot...
In the cacti log, i have this:
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] CMD: c:\php\php-win.exe -q D:\cacti\alvaro3.php, output: U
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] WARNING: Result from CMD not valid. Partial Result: SERVER XYZ:99.2973
Thank you,
Alvaro
- Attachments
-
- error.PNG (13.34 KiB) Viewed 7768 times
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
It does not like those lines starting with ":", where are they names for those values?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Well, as I understand, your script does not only return one value (this would be the simplest form of a custom script). Of course, it is possible to have a scripts return more than one value, but as stated in http://www.cacti.net/downloads/docs/htm ... thods.html this must follow a defined syntax: <parm1>:<value1> <parm2>:<value2> ... <parm n>:value n>
What I do not understand at the moment ist: what is the meaning of those strings in your example that are placed in front of the ":"? Are they host names?
Reinhard
What I do not understand at the moment ist: what is the meaning of those strings in your example that are placed in front of the ":"? Are they host names?
Reinhard
Reinhard and Tony,
Yes, they are hostnames (description names) and the numbers are the uptime in percent.
(SELECT description, availability FROM cacti.host)
I cannot understand why (when executed by cacti) return me this error...
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] CMD: c:\php\php-win.exe -q D:\cacti\alvaro3.php, output: U
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] WARNING: Result from CMD not valid. Partial Result: SERVER XYZ:99.2973
And how to fix this.
Thank you,
Alvaro
Yes, they are hostnames (description names) and the numbers are the uptime in percent.
(SELECT description, availability FROM cacti.host)
I cannot understand why (when executed by cacti) return me this error...
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] CMD: c:\php\php-win.exe -q D:\cacti\alvaro3.php, output: U
09/23/2005 11:43:18 AM - CMDPHP: Poller[0] Host[0] WARNING: Result from CMD not valid. Partial Result: SERVER XYZ:99.2973
And how to fix this.
Thank you,
Alvaro
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
You should modify your script so that it takes the hostname as an input parameter. And the output should only return the value (uptime in percent); no need to output the hostname. So it may look like
Please reread the docu in my last post. There you'll find a walkthrough how to configure cacti so that it
- will know your alvaro3.php as a Data Input Method
- will automatically append the hostname as an input parm
- how to define a data template based on the Data Input Method
- how to define a Graph Template to display the values
- how to apply this Graph Template to a host
Reinhard
Code: Select all
...alvaro3.php <server>
and it will return
99.992
- will know your alvaro3.php as a Data Input Method
- will automatically append the hostname as an input parm
- how to define a data template based on the Data Input Method
- how to define a Graph Template to display the values
- how to apply this Graph Template to a host
Reinhard
Re: Help on Script
Did Alvaro ever post his working script/template?
No longer a n00by, probably, by now an 0ldby
Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
Who is online
Users browsing this forum: No registered users and 1 guest