Templates for FreeBSD

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Author
Message
macan
Cacti User
Posts: 138
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech
Contact:

Templates for FreeBSD

#1 Post by macan » Wed Dec 21, 2011 12:08 pm

Hello,
I prepared host template for FreeBSD server. Host template making graphs and collecting values gained from ucd/generic snmp and own shell scripts. Part of monitored values is same as periodic.conf provides.

This host template contains templates for (RED - new graphs in version 2):
- processes and states
- apcups (line V, load, Battery charge, timeleft, temperature)
- files - open and maxfiles
- gmirror (total/active disk) and raid (camcontrol, mptutil)
- mail/client queue for sendmail and postfix
- mailstats statistics (bytes and count)
- named - number of requests, succesfull, authoritative and noauthoritative answers
- NTP (root dispersion, jitter, offset)
- installed ports (total/old/vulnerable)
- smartmontools - disks and errors
- spam - Spam, blacklist, greylist, ... statistics from maillog
- TCP connections - Count of connection for few ports (25, 80, ..)
- users (total/logged in/without password)
- raid status - camcontrol and mptutil
- denied packet
- uptime in days
- ...


Advantages:
- Data are collected only via snmp
- Lower load against collecting data via ssh command
- It is possible to add another values
- You can use data from shell script or a binary
- In combination with threshold = very useful alerting tool for everything (raid volume fail, ...)
- all important values from different sources (raid, smartmontools, apcupsd) are stored in one place

Installation, requirements, examples ... all in readme.txt.
Attachments
freebsd_host_template_v2.tgz
Version 2, cacti 0.8.8a
(938.93 KiB) Downloaded 1485 times
freebsd_host_template.tgz
Version 1, cacti 0.8.7g
(802.14 KiB) Downloaded 1066 times
forum2.png
forum2.png (188.35 KiB) Viewed 18703 times
forum1.png
forum1.png (200.89 KiB) Viewed 18703 times
Last edited by macan on Thu Aug 15, 2013 12:06 pm, edited 1 time in total.

paulbeard206
Cacti User
Posts: 149
Joined: Sat Jul 30, 2005 2:15 pm

Re: Templates for FreeBSD

#2 Post by paulbeard206 » Wed Dec 21, 2011 12:13 pm

Cool. I'll take a look.

User avatar
dust2k
Cacti User
Posts: 101
Joined: Sun Dec 04, 2005 3:14 am

Re: Templates for FreeBSD

#3 Post by dust2k » Fri Dec 23, 2011 2:19 am

Cool, this is definitly what I need for the moment!
This is just the beginning!

macan
Cacti User
Posts: 138
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech
Contact:

Re: Templates for FreeBSD

#4 Post by macan » Fri Dec 23, 2011 7:31 am

Thanks. I´m very glad to add other datasources and prepare graphs, if you are interested. Just write the value you want and the way to obtain values.

That's just the beginning :-)

User avatar
dust2k
Cacti User
Posts: 101
Joined: Sun Dec 04, 2005 3:14 am

Re: Templates for FreeBSD

#5 Post by dust2k » Sun Dec 25, 2011 9:38 pm

I am thinking to use this template monitoring pfsense, an open source firewall base on FreeBSD, I am stilling study the pfsense, and I will let you know once I understand pfsense better then I will let you know.

I found there is a thread (http://forum.pfsense.org/index.php/topic,41950.0.html) about MIBs of Pfsense, is it possible for you to create those figures on your template?

macan
Cacti User
Posts: 138
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech
Contact:

Re: Templates for FreeBSD

#6 Post by macan » Tue Dec 27, 2011 6:30 am

dust2k wrote:I am thinking to use this template monitoring pfsense, an open source firewall base on FreeBSD, I am stilling study the pfsense, and I will let you know once I understand pfsense better then I will let you know.

I found there is a thread (http://forum.pfsense.org/index.php/topic,41950.0.html) about MIBs of Pfsense, is it possible for you to create those figures on your template?
It is possible but I think it will be better when pfsense has own host template. I'm very busy now. I will prepare host template for pfsense in january/february.

macan
Cacti User
Posts: 138
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech
Contact:

Re: Templates for FreeBSD

#7 Post by macan » Wed Apr 04, 2012 7:35 am

macan wrote: It is possible but I think it will be better when pfsense has own host template. ...
Back to trees :-) I tried my template on pfsense and it works great.

PFSENSE HOWTO:

1) you need shell access, you have two ways:
- run sshd from console -> option 14 (enable secure shell) and ssh [email protected]
- run shell in console -> option 8

2) install packages:
- shell login (step 1)
- pkg_add -r ftp://ftp-archive.freebsd.org/pub/FreeB ... mp-ucd.tbz
- pkg_add -r ftp://ftp-archive.freebsd.org/pub/FreeB ... t/lsof.tbz
- other packages (portaudit, .... list of packages is in cacti_*.sh shell files)

(official help: http://doc.pfsense.org/index.php/Instal ... D_Packages)

3) Firewall rules (may not be necessary):
- via webgui allow udp port 161 from cacti host to pfsense ip

4) Upload shell scripts
- shell login
- upload content of shellscripts directory to any ftp server
- you can download shell scripts from any ftp server to fpsense:
ftp ftp.somewhere.net
lcd /usr/local/bin
cd /path/to/scripts
mget cacti_*.sh
confirm a
quit

5) change permissions
- shell login
- chmod 755 /usr/local/bin/cacti_*.sh

6) modify /etc/snmpd.config
- shell login
- via clipboard - append content of bsnmpd/bsnmpd-cacti.txt to the end of file /etc/snmpd.config

7) start (or restart) snmp daemon
- strat from webgui -> services -> snmp - checkbox on right side (must be checked), click save
- restart from shell:
/etc/rc.d/bsnmpd stop
/etc/rc.d/bsnmpd onestart

mcfuzz
Posts: 3
Joined: Sat Sep 29, 2012 4:59 am

Re: Templates for FreeBSD

#8 Post by mcfuzz » Sun Oct 21, 2012 7:28 pm

Raising this up from the dead a bit - but, I had Cacti graphing some stuff from pfSense, however after a recent reboot, it stopped graphing CPU, Load Averages, Processes and Memory utilization... it's like it is not getting any data but it does for hard drive space and NIC traffic...

Tried re-creating the device in Cacti, tried rebooting the Cacti box and pfSense itself - nothing!

Any ideas?

edit: speak of the devil - suddenly it went through... huh...

macan
Cacti User
Posts: 138
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech
Contact:

Re: Templates for FreeBSD

#9 Post by macan » Mon Oct 22, 2012 4:11 am

mcfuzz wrote:Raising this up from the dead a bit - but, I had Cacti graphing some stuff from pfSense, however after a recent reboot, it stopped graphing CPU, Load Averages, Processes and Memory utilization... it's like it is not getting any data but it does for hard drive space and NIC traffic...
CPU, Load, memory , ... everything is in bnsmp-ucd module.
Hard drive space is different module (hostres), NIC traffic too (bridge). It seems that module bsnmp-ucd isn't in system or loadable after reboot.

ls -al /usr/local/lib/snmp*
is here file or link with name snmp_ucd.so?

Try restart bsnmpd and watch logs.

hicmcs
Posts: 3
Joined: Tue Jan 29, 2013 3:14 am

Re: Templates for FreeBSD

#10 Post by hicmcs » Tue Jan 29, 2013 3:21 am

Disk data problem is to use 'ucd/net - Get Monitored Partitions'

macan
Cacti User
Posts: 138
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech
Contact:

Re: Templates for FreeBSD

#11 Post by macan » Tue Jan 29, 2013 3:31 am

hicmcs wrote:Disk data problem is to use 'ucd/net - Get Monitored Partitions'
Why? Where is problem?

hicmcs
Posts: 3
Joined: Tue Jan 29, 2013 3:14 am

Re: Templates for FreeBSD

#12 Post by hicmcs » Tue Jan 29, 2013 5:19 am

Simple talk, Host-RESOURCES-MIB value is not support by bsnmp-ucd.

So, I did use to UCD-SNMP-MIB value.

Look ${cacti_install_base_directory}/resource/snmp_queries/host_disk.xml and ${cacti_install_base_directory}/resource/snmp_queries/net-snmp_disk.xml.

Diff OID value in both files.

snmp_ucd.so in /etc/snmpd.config is base by UCD-SNMP. (I guess...) ^^;

macan
Cacti User
Posts: 138
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech
Contact:

Re: Templates for FreeBSD

#13 Post by macan » Tue Jan 29, 2013 6:09 am

hicmcs wrote:Simple talk, Host-RESOURCES-MIB value is not support by bsnmp-ucd.
Host-RESOURCES-MIB is supported by bsnmd. You have to uncomment in /etc/snmpd.config:
begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"

and restart bsnmpd

hicmcs
Posts: 3
Joined: Tue Jan 29, 2013 3:14 am

Re: Templates for FreeBSD

#14 Post by hicmcs » Tue Jan 29, 2013 8:29 pm

Right!

I didn't know... descript in snmp.config file... (default setting is disable)
So, Thank you! :)

macan
Cacti User
Posts: 138
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech
Contact:

Re: Templates for FreeBSD

#15 Post by macan » Wed Jan 30, 2013 2:26 am

hicmcs wrote:Right!

I didn't know... descript in snmp.config file... (default setting is disable)
So, Thank you! :)
Ok, I will add notice about it to new version of my template

Post Reply