However, when I run my program nothing is piped to it.Once the panel hangs up, the application will run the command line specified by the eventcmd setting in alarmreceiver.conf and pipe the events to the standard input of the application.
I know my program runs because it creates a file and I know that Alarm Receiver is logging events because it creates the event log. My test program is below. Am I misinterpreting how the event is sent to the program, or just writing my program incorrectly? Any help with this would be appreciated.
- Code: Select all
#include <stdio.h>
int main(int argc, char *argv[]){
FILE *fp;
char str[100];
fp=fopen("/tmp/testEventLog.txt", "a");
while(scanf("%s", str) != -1){
fprintf(fp, "%s\n", str);
}
fprintf(fp, "---\n");
fclose(fp);
}
Thank you very much,
-ED