How to use Device Rules (Automation)

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

Moderators: Moderators, Developers

Post Reply
Author
Message
Feliche
Posts: 4
Joined: Fri Jan 25, 2019 8:27 am
Location: Germany

How to use Device Rules (Automation)

#1 Post by Feliche » Fri Jan 25, 2019 10:30 am

Hi,

I want to assign a Device Template to a newly added Devie by using the Device Rules.

But how is the syntax for the matching.

I want to search a specific string within the sysDescr ... but i don't know how, please help ...


Didn't find anything on the internet

thank you
Last edited by Feliche on Mon Jan 28, 2019 9:10 am, edited 1 time in total.

User avatar
camerabob
Cacti User
Posts: 276
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: How to use Device Rules

#2 Post by camerabob » Fri Jan 25, 2019 3:03 pm

As far as I am aware, the device templates are for when you are creating new devices. You assign the template of say for example a Cisco switch when adding a new one. All the graphs and templates associated with Cisco switches will be available to use under that device without having to add them individually. If they are already defined, then I believe you have to go back to that existing device and change the template there. There isn't a way to have devices moved automatically. (unless there is something I have missed...)
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.4 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Feliche
Posts: 4
Joined: Fri Jan 25, 2019 8:27 am
Location: Germany

Re: How to use Device Rules

#3 Post by Feliche » Mon Jan 28, 2019 2:40 am

camerabob wrote:As far as I am aware, the device templates are for when you are creating new devices. You assign the template of say for example a Cisco switch when adding a new one. All the graphs and templates associated with Cisco switches will be available to use under that device without having to add them individually. If they are already defined, then I believe you have to go back to that existing device and change the template there. There isn't a way to have devices moved automatically. (unless there is something I have missed...)
There isn't a problem with die Device Templates, they work fine.

I want to asign them automaticaley to a new Device

thanks anyway

User avatar
camerabob
Cacti User
Posts: 276
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: How to use Device Rules

#4 Post by camerabob » Mon Jan 28, 2019 8:34 am

Under 'Settings', 'Device Defaults' you can set the template that new entries will receive, but it won't be dynamic. You will have to change it if you are going to be implementing a different type of device over time.
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.4 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Feliche
Posts: 4
Joined: Fri Jan 25, 2019 8:27 am
Location: Germany

Re: How to use Device Rules

#5 Post by Feliche » Mon Jan 28, 2019 8:49 am

camerabob wrote:Under 'Settings', 'Device Defaults' you can set the template that new entries will receive, but it won't be dynamic. You will have to change it if you are going to be implementing a different type of device over time.
And for what purpose ist the "device rules" feature in Cacti?
(see screenshot)
Attachments
Unbenannt.PNG
Unbenannt.PNG (24.48 KiB) Viewed 469 times

User avatar
camerabob
Cacti User
Posts: 276
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: How to use Device Rules

#6 Post by camerabob » Mon Jan 28, 2019 9:07 am

That is under the automation area. I have no idea how that works.
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.4 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4


Feliche
Posts: 4
Joined: Fri Jan 25, 2019 8:27 am
Location: Germany

Re: How to use Device Rules (Automation)

#8 Post by Feliche » Mon Jan 28, 2019 10:39 am

netniV wrote:That is the automation section.
I Know, as i said, i want to use the rules to add a template automaticaly
So,how is the Syntax for this ?

hope you can help
unfortunately your dokumentation about the automation section isn't too extensive

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: How to use Device Rules (Automation)

#9 Post by Pucho » Mon Jan 28, 2019 2:57 pm

Feliche wrote:
netniV wrote:That is the automation section.
I Know, as i said, i want to use the rules to add a template automaticaly
So,how is the Syntax for this ?

hope you can help
unfortunately your dokumentation about the automation section isn't too extensive
You've got basically 3 fields you could use to match the device you want to attach to that Cisco - Catalyst 2960 Template

Code: Select all

sysDescr = 1.3.6.1.2.1.1.1
So if you run an snmpget to one of your 2960s on that OID you'll get something like below.
System: Cisco IOS Software, C2960X Software (C2960X-UNIVERSALK9-M), Version
sysName = 1.3.6.1.2.1.1.5.0

Idem above but will output system name, whatever you named your device.

You can also have it by going to Console\Management\Devices and click on one of the devices, right on the top you'll see it if cacti is able to snmp them.

Having said that, you can now make up your regexp to match sysName something like

Code: Select all

^myswitchnamestartslikethis
And leave all the other ones blank, if that's enough or also match sysDescr with C2960

You get the idea. I'd post an screenshot but I don't use device rules. Graph rules is all I use at the moment.

Not sure what they do by default if you don't add regexp stuff but It'd be nice to have 3 basic criteria like 'starts with, ends with and contains'.
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

Post Reply