add str running to parsed statuses

This commit is contained in:
ccppi_production 2024-09-16 08:48:01 +00:00
parent 9fcaa5cfcb
commit 5ee37810ee
3 changed files with 3 additions and 2 deletions

View File

@ -1 +1 @@
gcc main.c config.c -lcurl -Wall -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -ldbus-1 gcc main.c config.c -lcurl -Wall -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -ldbus-1 -o systemd-gotify.bin

1
config
View File

@ -1,2 +1,3 @@
/org/freedesktop/systemd1/unit/NetworkManager_2dwait_2donline_2eservice /org/freedesktop/systemd1/unit/NetworkManager_2dwait_2donline_2eservice
/org/freedesktop/systemd1/unit/NetworkManager_2eservice /org/freedesktop/systemd1/unit/NetworkManager_2eservice
/org/freedesktop/systemd1/unit/httpd_2eservice

2
main.c
View File

@ -238,7 +238,7 @@ int checkState(char *ServiceName,char *result,Service *service)
gotify_message("https://5ccppi.org:4433",ServiceName,"is not running"); gotify_message("https://5ccppi.org:4433",ServiceName,"is not running");
printf("!!system unit died!! Alert gotify server!\n"); printf("!!system unit died!! Alert gotify server!\n");
} }
else if(strcmp(result,"active")==0) else if(strcmp(result,"active")==0 || strcmp(result,"running")==0)
{ {
if(service->alerted == true) if(service->alerted == true)
{ {