Please note that a similar post was also sent on mailing list, this is almost the same post as previous one, though differs a little, plus i am posting again hoping that this time i could get some real reference rather than google or reading 500 pages of documentation. Thanks…
I have a project developed using Java, in which a Servlet lists the all possible daemons/service of a system to which user is connected, the remote user selects the services he wants to monitor on that system, inputs his cell number and clicks save. This information (cell #, ip, and daemon monitor list) is stored in a file called .alerts of the following format:
number:ip:daemon1,daemon2,dameon3,daemon3
like:
1234567890:172.30.10.10:httpd,dhcpd,sshd,klogd
and the file contains a list of such entries, say 100 users has their entries in this file., What i want to do it to use nagios to check the status of the daemons/services mentioned in the file, and if any of these services changes status, goes down, etc, an sms should be sent to the number provided with the details of which daemon changes status on which server (ip) and etc…
Example:
//.alerts
1234567890:172.30.10.10:httpd,sshd,dhcpd
0987654321:172.30.10.10:klogd,sshd,mysqld
0987654321:172.30.10.11:mysqld
Case 1:
httpd changes status on 172.30.10.10:
SMS should be sent to 1234567890
SMS body:
httpd just changed its status to /down on the server at .
Case 2:
sshd changes status on 172.30.10.10
SMS should be sent to 1234567890 and 0987654321
SMS body:
sshd just changed its status to on the server at .
please note that entries in .alerts file can be modified, its possible that later using the web application 0987654321 subscribes for httpd on 172.30.10.10 as well, or 1234567890 unsubscribes for httpd on 172.30.10.10, so we will have to check that file at regular intervals. One more thing, remote host could be a windows based or nix based system (just if that matters, though in my opinion doesnt matter anymore as nagios achieved this long ago as per nagios documentation and the wikipedia page of nagios).
What i wanna know is can nagios do it? if yes? how? please post some short and useful manuals or links, i already know about notify_sms plugin and sms gateways (infact i have almost bought one from clickatell.com), my problem includes that how can i tell nagios to take that file as input on regular intervals say 10-15 minutes, parse it correctly, and do the desired things.
Thank you so much for reading the post, and willing to help me…