How can i add Uptime to the Statistics?
Moderators: Developers, Moderators
How can i add Uptime to the Statistics?
hi everybody,
i have search the forum for a post that describes how i can add the uptime of a host to the stats, but i can't find some thread which is helpfull for me.
can somebody help me with this problem? i use win2000 server, cacti is running perfect now i will add the uptime of my hosts..
hope somebody can help..
thx a log
i have search the forum for a post that describes how i can add the uptime of a host to the stats, but i can't find some thread which is helpfull for me.
can somebody help me with this problem? i use win2000 server, cacti is running perfect now i will add the uptime of my hosts..
hope somebody can help..
thx a log
-
- Posts: 49
- Joined: Fri Mar 18, 2005 7:33 am
- Location: France
Here's how I monitor the system uptime:
* Create the following script (I call it uptime.sh):
* Use the following data and graph templates (exported on cacti 0.8.6c). This is my first time adding a template so I hope I got it all. Your uptime graphs should look like:
* Create the following script (I call it uptime.sh):
Code: Select all
#!/bin/sh
uptime=`snmpget -Ov -c $1 -v 1 $2 system.sysUpTime.0 | awk '{print $3}'`
case $uptime in
*:*) uptime=0 ;;
*) ;;
esac
echo "$uptime";
- Attachments
-
- cacti_data_template_snmp_system_uptime.xml
- (4 KiB) Downloaded 1939 times
-
- cacti_graph_template_snmp_system_uptime.xml
- (8.28 KiB) Downloaded 2429 times
-
- uptime.JPG (33.86 KiB) Viewed 24695 times
Thomas Rupp
Hi,
I searched the archives and I think this posting should help: http://forums.cacti.net/viewtopic.php?t=2546
I searched the archives and I think this posting should help: http://forums.cacti.net/viewtopic.php?t=2546
Thomas Rupp
Hi Ghandi,
I had a look at the patch. It won't run on Windows because it calls a Skript using the *nix notation.
If you replace the line
with something like
then it should work on Windows as well.
P.S. I don't know anything about PHP and am not running CACTI on Windows so please handle my advice with care
I had a look at the patch. It won't run on Windows because it calls a Skript using the *nix notation.
If you replace the line
Code: Select all
@$uptime = exec("/home/httpd/html/cacti/scripts/snmp_cisco_uptime.sh " . $hostdata["snmp_community"] . " " . $hostdata["hostname"]);
Code: Select all
@$uptime = exec("C:\...\uptime.bat " . $hostdata["snmp_community"] . " " . $hostdata["hostname"]);
P.S. I don't know anything about PHP and am not running CACTI on Windows so please handle my advice with care
Thomas Rupp
-
- Posts: 49
- Joined: Fri Mar 18, 2005 7:33 am
- Location: France
I see ... but in this case you only have to add a few lines. The line numbers can be found in the heading of the patch file - so this should be quite easy to patch manually.scavenger67 wrote:that's not so easy because there is no patch method for cacti running on windows.
But as I said before, I have no CACTI running on Windows ...
Thomas Rupp
No, there is no variable for this feature (in this version of CACTI).
I would create a separate graph for uptime (see my above example) - this gives you the needed information with least effort.
BTW: What uptime data do you want to monitor? .iso.org.dod.internet.mgmt.mib-2.system.sysUpTime (.1.3.6.1.2.1.1.3) = "The time since the network management portion of the system was last re-initialized." or .iso.org.dod.internet.mgmt.mib-2.host.hrSystem.hrSystemUptime (.1.3.6.1.2.1.25.1.1) = "The amount of time since this host was last initialized."
P.S. Schöne Grüße vom Bodensee nach Graz
I would create a separate graph for uptime (see my above example) - this gives you the needed information with least effort.
BTW: What uptime data do you want to monitor? .iso.org.dod.internet.mgmt.mib-2.system.sysUpTime (.1.3.6.1.2.1.1.3) = "The time since the network management portion of the system was last re-initialized." or .iso.org.dod.internet.mgmt.mib-2.host.hrSystem.hrSystemUptime (.1.3.6.1.2.1.25.1.1) = "The amount of time since this host was last initialized."
P.S. Schöne Grüße vom Bodensee nach Graz
Thomas Rupp
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
We currently keep uptime in one of our tables. It would not be a major hack to provide it as a GPRINT in the next version.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
who?
Who I can add this graph (detailed) on my Cacti system using Net-SNMP for Windows?Thomas wrote:Here's how I monitor the system uptime:
* Create the following script (I call it uptime.sh):* Use the following data and graph templates (exported on cacti 0.8.6c). This is my first time adding a template so I hope I got it all. Your uptime graphs should look like:Code: Select all
#!/bin/sh uptime=`snmpget -Ov -c $1 -v 1 $2 system.sysUpTime.0 | awk '{print $3}'` case $uptime in *:*) uptime=0 ;; *) ;; esac echo "$uptime";
SNMPGET returns the following value:
My script takes token 3 (with AWK) and checks if it contains a ":". If yes, then uptime is < 1 day and the script returns 0.
If you can create a script (perl?) then it should be possible for windows as well.
I've found the following skript for an UPS:
Please be careful and test all code! I'm running on Linux so my Windows suggestions are all theoretical!
Code: Select all
Timeticks: (43847204) 5 days, 1:47:52.04
If you can create a script (perl?) then it should be possible for windows as well.
I've found the following skript for an UPS:
Code: Select all
#!/usr/bin/perl
#
# Script to convert runtime MIB variable for UPS into minutes
$a=`snmpget -v1 -c public $ARGV[0] .1.3.6.1.4.1.318.1.1.1.2.2.3.0`;
chomp $a;
@b=split(/ /,$a);
@c=split(/:/,$b[4]);
$z = eval($c[0] * 60 + $c[1]),"\n";
print $z;
Thomas Rupp
Who is online
Users browsing this forum: No registered users and 0 guests