Skip to content

Commit

Permalink
added the hostname to email alerts for psadwatchd
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/mbr/svn/psad_repos/psad/trunk@436 91a0a83b-1414-0410-bf9a-c3dbc33e90b6
  • Loading branch information
mrash committed Nov 25, 2002
1 parent 43ff316 commit b1155eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions install.pl
Expand Up @@ -162,19 +162,19 @@ ()

unless (-d $RUNDIR) {
&logr(" ... Creating $RUNDIR\n");
mkdir $RUNDIR,0500;
mkdir $RUNDIR, 0500;
}
unless (-d $VARLIBDIR) {
&logr(" ... Creating $VARLIBDIR\n");
mkdir $VARLIBDIR,0500;
mkdir $VARLIBDIR, 0500;
}
unless (-d $LIBDIR) {
&logr(" ... Creating $LIBDIR\n");
mkdir $LIBDIR,0500;
mkdir $LIBDIR, 0500;
}
unless (-d $PSAD_CONFDIR) {
&logr(" ... Creating $PSAD_CONFDIR\n");
mkdir $PSAD_CONFDIR,0500;
mkdir $PSAD_CONFDIR, 0500;
}
unless (-d $CONF_ARCHIVE) {
&logr(" ... Creating $CONF_ARCHIVE\n");
Expand Down Expand Up @@ -289,8 +289,8 @@ ()
open PH, "> psad.h";
for my $line (@lines) {
chomp $line;
if ($line =~ /^#define\s+HOSTNAME\s+HOSTNAME/) {
print PH "#define HOSTNAME $HOSTNAME\n";
if ($line =~ /^#define\s+HOSTNAME\s+\"HOSTNAME\"/) {
print PH "#define HOSTNAME \"$HOSTNAME\"\n";
} else {
print PH $line . "\n";
}
Expand All @@ -307,7 +307,7 @@ ()
unlink 'kmsgsd' if -e 'kmsgsd';
### remove any previously compiled psadwatchd
unlink 'psadwatchd' if -e 'psadwatchd';
system "$Cmds{'make'}";
system $Cmds{'make'};
if (! -e 'kmsgsd' && -e 'kmsgsd.pl') {
&logr(" ... @@@ Could not compile kmsgsd.c. Installing perl kmsgsd.\n");
unless ((system "$Cmds{'perl'} -c kmsgsd.pl") == 0) {
Expand Down Expand Up @@ -343,18 +343,22 @@ ()

### put the psad daemons in place
&logr(" ... Copying psad -> ${SBIN_DIR}/psad\n");
unlink "${SBIN_DIR}/psad" if -e "${SBIN_DIR}/psad";
copy 'psad', "${SBIN_DIR}/psad";
&perms_ownership("${SBIN_DIR}/psad", 0500);

&logr(" ... Copying psadwatchd -> ${SBIN_DIR}/psadwatchd\n");
unlink "${SBIN_DIR}/psadwatchd" if -e "${SBIN_DIR}/psadwatchd";
copy 'psadwatchd', "${SBIN_DIR}/psadwatchd";
&perms_ownership("${SBIN_DIR}/psadwatchd", 0500);

&logr(" ... Copying kmsgsd -> ${SBIN_DIR}/kmsgsd\n");
unlink "${SBIN_DIR}/kmsgsd" if -e "${SBIN_DIR}/kmsgsd";
copy 'kmsgsd', "${SBIN_DIR}/kmsgsd";
&perms_ownership("${SBIN_DIR}/kmsgsd", 0500);

&logr(" ... Copying diskmond -> ${SBIN_DIR}/diskmond\n");
unlink "${SBIN_DIR}/diskmond" if -e "${SBIN_DIR}/diskmond";
copy 'diskmond', "${SBIN_DIR}/diskmond";
&perms_ownership("${SBIN_DIR}/diskmond", 0500);

Expand Down
2 changes: 1 addition & 1 deletion psad.h
Expand Up @@ -49,7 +49,7 @@
#define CONFIG_FILE "/etc/psad/psad.conf" /* default config file */

/* this will automatically be set by install.pl */
#define HOSTNAME HOSTNAME
#define HOSTNAME "HOSTNAME"

#define MAX_LINE_BUF 1024
#define MAX_PID_SIZE 5
Expand Down

0 comments on commit b1155eb

Please sign in to comment.