Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
tweak plugins description
Browse files Browse the repository at this point in the history
  • Loading branch information
joergsteffens committed Nov 20, 2014
1 parent b43010b commit 14c48cd
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions manuals/en/main/plugins.tex
Expand Up @@ -11,7 +11,7 @@ \chapter{Plugins}
\section{File Daemon Plugins}
\label{fdPlugins}

File Daemon plugins are configured by the \configdirective{plugin} directive of a FileSet, see the \ilink{File Set}{directive-fileset-plugin} section.
File Daemon plugins are configured by the \configdirective{Plugin} directive of a \ilink{File Set}{directive-fileset-plugin}.

\warning{Currently the plugin command is being stored as part of the backup. The restore command in your directive should be flexible enough if things might change in future, otherwise you could run into trouble.}

Expand Down Expand Up @@ -90,7 +90,7 @@ \subsection{python-fd Plugin}
\index[general]{Plugin!Python!File Daemon}
The \name{python-fd} plugin behaves similar to the \nameref{director-python-plugin}. Base plugins and an example get installed via the package bareos-filedaemon-python-plugin.
Configuration is done in the FileSet-resource on the director.
Configuration is done in the \nameref{DirectorResourceFileSet} on the director.
We basically distinguish between command-plugin and option-plugins.
Expand All @@ -106,12 +106,12 @@ \subsubsection{Command Plugins}
Signature = MD5 # calculate md5 checksum per file
}
File = "/etc"
Plugin = "python:module_path=/usr/lib/bareos/plugins:module_name=bareos-fd-mysql"
Plugin = "python:module_path=/usr/lib/bareos/plugins:module_name=bareos-fd-mysql"
}
}
\end{bconfig}
This example uses the MySQL\index[general]{MySQL!Backup} plugin from \elink{GIT}{https://github.com/bareos/bareos-contrib/tree/master/fd-plugins/mysql-python} to backup MySQL dumps in addition to /etc.
This example uses the MySQL\index[general]{MySQL!Backup} plugin from \url{https://github.com/bareos/bareos-contrib/tree/master/fd-plugins/mysql-python} to backup MySQL dumps in addition to \file{/etc}.
\subsubsection{Option Plugins}
Option plugins are activated in the Options resource of a FileSet definition.
Expand All @@ -132,7 +132,7 @@ \subsubsection{Option Plugins}
}
\end{bconfig}
This plugin bareos-fd-file-interact from \elink{GIT}{https://github.com/bareos/bareos-contrib/tree/master/fd-plugins/options-plugin-sample} has a method that is called before and after each file that goes into the backup,
This plugin bareos-fd-file-interact from \url{https://github.com/bareos/bareos-contrib/tree/master/fd-plugins/options-plugin-sample} has a method that is called before and after each file that goes into the backup,
it can be used as a template for whatever plugin wants to interact with files before or after backup.
\section{Storage Daemon Plugins}
Expand Down Expand Up @@ -232,15 +232,11 @@ \subsection{python-dir Plugin}
\item restart the Bareos Director
\end{itemize}
\subsubsection*{Limitations}
\begin{itemize}
\item Currently there can be only one Python plugin per Director. The plugin only loads the file \file{bareos-dir.py}.
\item Fixed since 14.4: now multiple Python plugins can be loaded and plugin names can be arbitrary.
\end{itemize}
\subsubsection{Loading plugins}
Since \sinceVersion{dir}{multiple Python plugins can be used}{14.4} multiple Python plugins can be loaded and plugin names can be arbitrary. Before this, the Python plugin always loads the file \file{bareos-dir.py}.
The director plugins are configured in the Job-Resource (or JobDefs resource). To load a Python plugin you need
\begin{itemize}
\item [module\_path= ] pointing to your plugin directory (needs to be enabled in the Director resource, too
Expand All @@ -253,7 +249,6 @@ \subsubsection{Loading plugins}
Example:
\begin{bconfig}{bareos-dir.conf: Python Plugins}
Director {
# ...
# Plugin directory
Expand All @@ -267,12 +262,14 @@ \subsubsection{Loading plugins}
Type = Backup
# ...
# Load the class based plugin with testoption=testparam
DIR Plugin Options ="python:instance=0:module_path=/usr/lib64/bareos/plugins:module_name=bareos-dir-class-plugins:testoption=testparam
Dir Plugin Options = "python:instance=0:module_path=/usr/lib64/bareos/plugins:module_name=bareos-dir-class-plugins:testoption=testparam
# ...
}
\end{bconfig}
\subsubsection{Write your own Python Plugin}
Some plugin examples are available on \elink{GIT}{https://github.com/bareos/bareos-contrib}. The class-based approach lets you easily reuse stuff already
defined in the baseclass BareosDirPluginBaseclass, which ships with the bareos-director-python-plugin package.
Some plugin examples are available on \url{https://github.com/bareos/bareos-contrib}.
The class-based approach lets you easily reuse stuff already
defined in the baseclass BareosDirPluginBaseclass, which ships with the \package{bareos-director-python-plugin} package.
The examples contain the plugin bareos-dir-nsca-sender, that submits the results and performance data of a backup job directly to Icinga\index[general]{Icinga} or Nagios\index[general]{Nagios|see{Icinga}} using the NSCA protocol.

0 comments on commit 14c48cd

Please sign in to comment.