How to extract a portion of text from a Web page.

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Pratapa
Posts: 144
Joined: Tue Oct 01, 2019 1:33 am

How to extract a portion of text from a Web page.

Post by Pratapa »

Hi,

How to extract a portion of text from a Web page.

If we can extract using grep command, please let me know the syntax.

Regards,
Pratapa
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to extract a portion of text from a Web page.

Post by scottwilkerson »

Are you looking to check for existence of a certain string?

this can be done with check_http with either a string match

Code: Select all

 -s, --string=STRING
    String to expect in the content
or a regex match

Code: Select all

 -r, --regex, --ereg=STRING
    Search page for regex STRING
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked