cli / api question, now to add all avail data to graph?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
BvFc2
Posts: 1
Joined: Tue May 24, 2016 9:14 am

cli / api question, now to add all avail data to graph?

Post by BvFc2 »

I have fresh cacti + snmpd installed on debian 8.4.

I have added 127.0.0.1 host (re-add it) and went to
http://localhost/cacti/graphs_new.php?host_id=2
I have changed Graph Types: to All.
Now I can see and add ALL avail data on graph with one button.

I need to do the same thing but with CLI/or API (if some API presented).
As much easy as it possible.. Please help.

I done some dig in this way and found way determine what data is present:

root@debian:/usr/share/cacti/cli# ./add_graphs.php --host-id=2 --snmp-query-id=2 --list-snmp-fields
Known SNMP Fields for host-id 59: (name)
dskDevice
dskIndex
dskPath

root@debian:/usr/share/cacti/cli# ./add_graphs.php --host-id=2 --snmp-query-id=3 --list-snmp-fields
Known SNMP Fields for host-id 59: (name)

root@debian:/usr/share/cacti/cli# ./add_graphs.php --host-id=2 --snmp-query-id=4 --list-snmp-fields
Known SNMP Fields for host-id 59: (name)

root@debian:/usr/share/cacti/cli# ./add_graphs.php --host-id=2 --snmp-query-id=5 --list-snmp-fields
ERROR: Unknown snmp-query-id (5)
Try --list-snmp-queries
root@debian:/usr/share/cacti/cli# ./add_graphs.php --host-id=2 --snmp-query-id=6 --list-snmp-fields
Known SNMP Fields for host-id 59: (name)
dskDevice
dskMount

root@debian:/usr/share/cacti/cli# ./add_graphs.php --host-id=2 --snmp-query-id=7 --list-snmp-fields
Known SNMP Fields for host-id 59: (name)

root@debian:/usr/share/cacti/cli# ./add_graphs.php --host-id=2 --snmp-query-id=8 --list-snmp-fields
Known SNMP Fields for host-id 59: (name)
hrStorageAllocationUnits
hrStorageDescr
hrStorageIndex

root@debian:/usr/share/cacti/cli# ./add_graphs.php --host-id=2 --snmp-query-id=9 --list-snmp-fields
Known SNMP Fields for host-id 59: (name)

Here is the complete example to add piece of data go graph, but it contains much more arguments than just host ID:
./add_graphs.php --host-id=2 --graph-type=ds --graph-template-id=2 --snmp-query-id=1 --snmp-query-type-id=13 --snmp-field=ifOperStatus --snmp-value=Up
BTW, I can't add graph without --snmp-value, and without --snmp-field,
so, looks like I need to collect right values for it...In conclusion.. collecting data with add_graphs.php --list options , parsing it with PHP take me to so much complicated code that I just drop it.
I have no ideas how to achieve my goal.
Please help.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests