Display uptime?
Moderators: Developers, Moderators
Display uptime?
Any way to get an Uptime display for a host, in a graph preferrably? Looking to get similar to what MRTG provides.
Thanks
Thanks
-----
Its not a penalty unless the ref sees it!
Its not a penalty unless the ref sees it!
- NetVicious
- Posts: 49
- Joined: Mon Oct 13, 2003 1:14 pm
- Location: Spain
Create a script <path_cacti>/scripts/snmpUptime.sh with this:
snmpget -v1 -Cf -c $1 $2 $3 | awk '{ print $5 }'
Create a Data Input Method linking to this script
Input String:
bash <path_cacti>/scripts/snmpUptime.sh <community> <host> <oid>
Output String:
<uptime>
On the Data Template write the OID:
.1.3.6.1.2.1.1.3.0
snmpget -v1 -Cf -c $1 $2 $3 | awk '{ print $5 }'
Create a Data Input Method linking to this script
Input String:
bash <path_cacti>/scripts/snmpUptime.sh <community> <host> <oid>
Output String:
<uptime>
On the Data Template write the OID:
.1.3.6.1.2.1.1.3.0
.. //\/ e t . \/ i c i o u s ..
Geeze
You guys have to be more descriptive than this...
Please try to assume that other people who aren't familiar with this sytem will be reading it
Please try to assume that other people who aren't familiar with this sytem will be reading it
NetVicious wrote:Create a script <path_cacti>/scripts/snmpUptime.sh with this:
snmpget -v1 -Cf -c $1 $2 $3 | awk '{ print $5 }'
Create a Data Input Method linking to this script
Input String:
bash <path_cacti>/scripts/snmpUptime.sh <community> <host> <oid>
Output String:
<uptime>
On the Data Template write the OID:
.1.3.6.1.2.1.1.3.0
I've made a change here to allow the uptime to be displayed in the graph as a comment. It uses a script to do an snmp get on the target device. After applying the patch you can just use |sys_uptime| in your comment and it will replace it with the uptime.
e.g Uptime: |sys_uptime| will print a comment like Uptime: 195 days, 14:04:22.12 on the graph.
You might need to change the path to your cacti scripts directory in the patch before applying it (sorry I couldn't make it cleaner!).
e.g Uptime: |sys_uptime| will print a comment like Uptime: 195 days, 14:04:22.12 on the graph.
You might need to change the path to your cacti scripts directory in the patch before applying it (sorry I couldn't make it cleaner!).
- Attachments
-
- rrd_php_show_uptime.zip
- Show uptime in graph patch, shell script to retrieve uptime.
- (808 Bytes) Downloaded 951 times
Speedster - Your patch applies cleanly to 0.8.4, but for some reason I'm unable to get the uptime onto the graph. I'm using FreeBSD 4.9 and I did check that the OID reported the uptime. I had to edit the patch to get the path to the script correct, and the script is exectutable - so I'm at a loss why it won't work. Any thoughts?
- Attachments
-
- graph_image.php.png (4.28 KiB) Viewed 13236 times
I'd give my right arm to be ambidextrous
-
- Cacti User
- Posts: 83
- Joined: Fri Aug 22, 2003 4:33 am
how do i pass a comment
i am new to snmp,rrd,mrtg.....how do i pass a comment Uptime
chetan.
chetan.
Hi guys,
I've made patch but graphs no longer showing. I get an erro message when I click on "source":
script name for uptime is snmp_cisco_uptime.sh under script/ directory
Can anyone help me with this?
Thanks in advance
I've made patch but graphs no longer showing. I get an erro message when I click on "source":
Code: Select all
Warning: Undefined variable: current_field in /opt/cacti-0.8.5/lib/rrd.php on line 637
/usr/bin/rrdtool graph - \
--imgformat=GIF \
--start=end-138240 \
--end=1081433361 \
COMMENT:"From 2004-04-07 01:45:21 to 2004-04-08 16:09:21\c" \
COMMENT:"Graph Generated at 2004-04-08 16:09:21\c" \
--title="battery_in_voltage" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
DEF:a="/opt/cacti-0.8.5/rra/t_vilnsav_ups_4_in_voltage_358.rrd":in_voltage:AVERAGE \
AREA:a#FF7D00:"" \
GPRINT:a:LAST:"Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"
Can anyone help me with this?
Thanks in advance
Who is online
Users browsing this forum: No registered users and 0 guests