LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   webpage contains check through nagios (https://www.linuxquestions.org/questions/linux-software-2/webpage-contains-check-through-nagios-944948/)

ratotopi 05-14-2012 05:07 PM

webpage contains check through nagios
 
Does any one has any idea how we can check if the contains of the webpage is the same as the previous one or is there a way in nagios to check if the webpage contains has changed. Thank you

acid_kewpie 05-16-2012 01:49 AM

to check if it's changed, I would write a check script that would use curl to grab the page and save it to disk (or take an MD5sum of the page data), and then pick up that file next time and compare it. The point of nagios check scripts (which are awful) is that they're just an arbitrary script with a predefined output, so just write your own script to do this.

ratotopi 05-16-2012 12:55 PM

thank you acid_kewpie, I did read that "md5 program was originally developed as part of a suite of tools intended to monitor large collections of files (for example, the contents of a Web site)" but I couldnt find any site to learn how to create MD5sum webpage, it's not like creating MD5sum iso files :( .

acid_kewpie 05-16-2012 01:44 PM

it is, I just don't think you understand what I'm talking about. You can pipe any data into md5sum:

Code:

[chris@thinkpad ~]$ curl 2>/dev/null google.com | md5sum
d4b691cd9d99117b2ea34586d3e7eeb8  -

for example

ratotopi 05-16-2012 06:35 PM

thanks


All times are GMT -5. The time now is 03:59 PM.