HELP request - Multiple (--input-fields=) - add graph with multiple data sources via cmd

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

Moderators: Developers, Moderators

Post Reply
saulofonseca
Posts: 40
Joined: Mon Jun 25, 2018 5:35 pm

HELP request - Multiple (--input-fields=) - add graph with multiple data sources via cmd

Post by saulofonseca »

Hello,

I searched before asking, but couldn't find a solution.

I'm trying to automate the creation of multiple graphs, but having trouble with this:

[--input-fields="[data-template-id:]field-name=value ..."] [--force]

Here is my output from --list-imput-fields:

[root@cacti scripts]# php /usr/share/cacti/cli/add_graphs.php --graph-type=cg --graph-template-id=40 --host-id=2 --graph-title=test --list-input-fields
Known Input Fields: (name, default, description)
25:serial Serial
49:serial Serial
50:serial Serial
51:serial Serial

The problem is with the syntax of how multiple input fields are inserted here: [--input-fields="[data-template-id:]field-name=value ..."]

OUTPUT:
php add_graphs.php --graph-type=cg --graph-template-id=40 --host-id=2 --graph-title=test --input-fields="25:serial,49:serial,50:serial,51:serial"=MONU00f80381

ERROR: Unknown input-field (serial,49)
Try --list-input-fields

May I have some help please ???

Regards

Att.
Saulo Fonseca
saulofonseca
Posts: 40
Joined: Mon Jun 25, 2018 5:35 pm

Re: HELP request - Multiple (--input-fields=) - add graph with multiple data sources via cmd

Post by saulofonseca »

Hello to all.

I figured it out. The command below worked.

$php $path/add_graphs.php --graph-type=cg --graph-template-id=40 --host-id=2 --graph-title=test --input-fields="25:serial=MONU00f80381 49:serial=MONU00f80381 50:serial=MONU00f80381 51:serial=MONU00f80381" --force

Regards
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests