I have been trying to create a program (in C) to read events from Alarm Receiver. The documentation states that [quote]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.[/quote] However, when I run my program nothing is piped to it.
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.
#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