resources = {
USER206 = config.myEnv.monitoring.slack_channel;
USER207 = config.myEnv.monitoring.slack_url;
- USER210 = config.myEnv.monitoring.eban.user;
- USER211 = config.myEnv.monitoring.eban.password;
};
commands = {
# $OVE is to force naemon to run via shell instead of execve which fails here
# $OVE is to force naemon to run via shell instead of execve which fails here
notify-service-by-email = "ADMINEMAIL=\"$ADMINEMAIL$\" SERVICENOTIFICATIONID=\"$SERVICENOTIFICATIONID$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_email service \"$NOTIFICATIONTYPE$\" \"$HOSTALIAS$\" \"$LONGDATETIME$\" \"$CONTACTEMAIL$\" $OVE";
notify-by-slack = "HOST=\"$HOSTALIAS$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_slack \"$ARG1$\" \"$ARG2$\"";
- notify-host-eban-url = "STATUS_NAME=\"Server\" USER=\"$USER210$\" PASSWORD=\"$USER211$\" HOSTSTATE=\"$HOSTSTATE$\" $USER2$/notify_eban_url";
- notify-service-eban-url = "STATUS_NAME=\"$_SERVICEWEBSTATUS_NAME$\" USER=\"$USER210$\" PASSWORD=\"$USER211$\" SERVICESTATE=\"$SERVICESTATE$\" $USER2$/notify_eban_url";
};
chunk = ''
- cp ${./plugins}/{notify_by_email,notify_by_slack,notify_eban_url} $out
- patchShebangs $out/{notify_by_email,notify_by_slack,notify_eban_url}
+ cp ${./plugins}/{notify_by_email,notify_by_slack} $out
+ patchShebangs $out/{notify_by_email,notify_by_slack}
wrapProgram $out/notify_by_email --prefix PATH : ${lib.makeBinPath [
pkgs.mailutils
]}
wrapProgram $out/notify_by_slack --prefix PATH : ${lib.makeBinPath [
pkgs.curl pkgs.jq
]}
- wrapProgram $out/notify_eban_url --prefix PATH : ${lib.makeBinPath [
- pkgs.curl
- ]}
'';
};
bandwidth = {
postgresql = {
commands = {
check_postgresql_replication = "${sudo} -u postgres $USER2$/check_postgres_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\"";
+ check_postgresql_database_count = "$USER2$/check_postgres_database_count \"$ARG1$\" \"$ARG2$\" \"$ARG3$\"";
};
chunk = let
postgresqlBinary = if config.myServices.databasesReplication.postgresql.enable
wrapProgram $out/check_postgres_replication --prefix PATH : ${lib.makeBinPath [
postgresqlBinary
]}
+ cp ${./plugins}/check_postgres_database_count $out/
+ patchShebangs $out/check_postgres_database_count
+ wrapProgram $out/check_postgres_database_count --prefix PATH : ${lib.makeBinPath [
+ postgresqlBinary
+ ]}
'';
sudo = myplugins: {
zfs = {
commands = {
check_zfs = "$USER2$/check_zpool.sh -p ALL -w 80 -c 90";
+ check_zfs_snapshot = "$USER2$/check_zfs_snapshot -d $ARG1$ -c 18000 -w 14400";
};
chunk = let
zfsPlugin = pkgs.fetchurl {
wrapProgram $out/check_zpool.sh --prefix PATH : ${lib.makeBinPath [
pkgs.which pkgs.zfs pkgs.gawk
]}
+ cp ${./plugins}/check_zfs_snapshot $out
+ patchShebangs $out/check_zfs_snapshot
+ wrapProgram $out/check_zfs_snapshot --prefix PATH : ${lib.makeBinPath [
+ pkgs.zfs pkgs.coreutils pkgs.gawk pkgs.gnugrep
+ ]}
'';
};
}