Templates for FreeBSD

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

Moderators: Developers, Moderators

User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Templates for FreeBSD

Post by macan »

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 1790 times
freebsd_host_template.tgz
Version 1, cacti 0.8.7g
(802.14 KiB) Downloaded 1252 times
forum2.png
forum2.png (188.35 KiB) Viewed 22083 times
forum1.png
forum1.png (200.89 KiB) Viewed 22083 times
Last edited by macan on Thu Aug 15, 2013 12:06 pm, edited 1 time in total.
Let the Cacti grow!
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

Re: Templates for FreeBSD

Post by paulbeard206 »

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

Post by dust2k »

Cool, this is definitly what I need for the moment!
This is just the beginning!
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Templates for FreeBSD

Post by macan »

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 :-)
Let the Cacti grow!
User avatar
dust2k
Cacti User
Posts: 101
Joined: Sun Dec 04, 2005 3:14 am

Re: Templates for FreeBSD

Post by dust2k »

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?
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Templates for FreeBSD

Post by macan »

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.
Let the Cacti grow!
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Templates for FreeBSD

Post by macan »

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 admin@pf.sense.ip.address
- 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
Let the Cacti grow!
mcfuzz
Posts: 3
Joined: Sat Sep 29, 2012 4:59 am

Re: Templates for FreeBSD

Post by mcfuzz »

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...
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Templates for FreeBSD

Post by macan »

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.
Let the Cacti grow!
hicmcs
Posts: 3
Joined: Tue Jan 29, 2013 3:14 am

Re: Templates for FreeBSD

Post by hicmcs »

Disk data problem is to use 'ucd/net - Get Monitored Partitions'
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Templates for FreeBSD

Post by macan »

hicmcs wrote:Disk data problem is to use 'ucd/net - Get Monitored Partitions'
Why? Where is problem?
Let the Cacti grow!
hicmcs
Posts: 3
Joined: Tue Jan 29, 2013 3:14 am

Re: Templates for FreeBSD

Post by hicmcs »

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...) ^^;
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Templates for FreeBSD

Post by macan »

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
Let the Cacti grow!
hicmcs
Posts: 3
Joined: Tue Jan 29, 2013 3:14 am

Re: Templates for FreeBSD

Post by hicmcs »

Right!

I didn't know... descript in snmp.config file... (default setting is disable)
So, Thank you! :)
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Templates for FreeBSD

Post by macan »

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
Let the Cacti grow!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest