PHPackages                             cytopia/check\_http\_expect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. cytopia/check\_http\_expect

ActiveLibrary[HTTP &amp; Networking](/categories/http)

cytopia/check\_http\_expect
===========================

Nagios plugin to check for a string/regex on a webpage. Also works behind .htaccess and POST login.

0.5(7y ago)65.6k4[1 PRs](https://github.com/cytopia/check_http_expect/pulls)MITShell

Since Oct 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/cytopia/check_http_expect)[ Packagist](https://packagist.org/packages/cytopia/check_http_expect)[ Docs](https://github.com/cytopia/check_http_expect)[ RSS](/packages/cytopia-check-http-expect/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (7)Used By (0)

check\_http\_expect
===================

[](#check_http_expect)

Nagios plugin that will check a website (behind .htacess and/or behind POST login) for an expected string based on a simple string or regex expression.

[![Build Status](https://camo.githubusercontent.com/c02510a7bc6e252973152ac0420074721c4273399ae139eb0a084c638920c002/68747470733a2f2f7472617669732d63692e6f72672f6379746f7069612f636865636b5f687474705f6578706563742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cytopia/check_http_expect)[![Latest Stable Version](https://camo.githubusercontent.com/1f4f428d689e89de9569dbd1435f1531991857ea4610a4e1944888d52bc9d657/68747470733a2f2f706f7365722e707567782e6f72672f6379746f7069612f636865636b5f687474705f6578706563742f762f737461626c65)](https://packagist.org/packages/cytopia/check_http_expect) [![Total Downloads](https://camo.githubusercontent.com/9c1d795397ef4f0d67ba1a92a6cca68f26403a07bf42cb450983ea7c1354acfd/68747470733a2f2f706f7365722e707567782e6f72672f6379746f7069612f636865636b5f687474705f6578706563742f646f776e6c6f616473)](https://packagist.org/packages/cytopia/check_http_expect) [![Latest Unstable Version](https://camo.githubusercontent.com/5b631dec255691f487afef79a6766917e650dd9c4a7ee57c07e43b045a612f95/68747470733a2f2f706f7365722e707567782e6f72672f6379746f7069612f636865636b5f687474705f6578706563742f762f756e737461626c65)](https://packagist.org/packages/cytopia/check_http_expect) [![License](https://camo.githubusercontent.com/c3d2a214ab42b4886fa82581311fa780a08ae9dd452ae95b022e779247b46c61/68747470733a2f2f706f7365722e707567782e6f72672f6379746f7069612f636865636b5f687474705f6578706563742f6c6963656e7365)](http://opensource.org/licenses/MIT)[![POSIX](https://camo.githubusercontent.com/feb63e4a980dfcca96f4cc1f5d5a8ed53ea3951e4db4bc39427267e5245978bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706f7369782d3130302532352d627269676874677265656e2e737667)](https://en.wikipedia.org/?title=POSIX)[![Type](https://camo.githubusercontent.com/466a2aaa559c1fa8990a00e9b3d30900ae8559d4f772913b12b1cd334e0ffeac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f747970652d25324662696e25324673682d7265642e737667)](https://en.wikipedia.org/?title=Bourne_shell)

---

[![Awesome-Nagios-Plugins](https://raw.githubusercontent.com/cytopia/awesome-nagios-plugins/master/doc/img/awesome-nagios.png)](https://github.com/cytopia/awesome-nagios-plugins)Find more plugins at [Awesome Nagios](https://github.com/cytopia/awesome-nagios-plugins)[![Icinga Exchange](https://raw.githubusercontent.com/cytopia/awesome-nagios-plugins/master/doc/img/icinga.png)](https://exchange.icinga.com/cytopia)**Find more plugins at [Icinga Exchange](https://exchange.icinga.com/cytopia)**[![Nagios Exchange](https://raw.githubusercontent.com/cytopia/awesome-nagios-plugins/master/doc/img/nagios.png)](https://exchange.nagios.org/directory/Owner/cytopia/1)**Find more plugins at [Nagios Exchange](https://exchange.nagios.org/directory/Owner/cytopia/1)**---

1. Usage
--------

[](#1-usage)

```
Usage:  check_http_expect --url  --find  [--find ] [--huser ] [--hpass ] [--lurl ] [--cookie  [--cookie ]] [--ldata  [--ldata ]]

  --url         Target URL
  --find        Find string in source of Target URL ('grep -E'-style regex allowed / can be specified multiple times)
  --huser       (Optional) htaccess username
  --hpass       (Optional) htaccess password
  --lurl        (Optional) Url for POST login
  --ldata       (Optional) POST data (can be specified multiple times)
  --cookie      (Optional) set cookies for request
  --ua          (Optional) use this user-agent instead of the default one
```

2. Generic Examples
-------------------

[](#2-generic-examples)

### 2.1 Search simple string

[](#21-search-simple-string)

Check if a website contains the word `google`

```
$ check_http_expect --url https://google.com --find google
[OK] 1 match found for: "google".
Http version:  HTTP/1.1
Http code:     302
Http info:     Found
Server:        GFE/2.0
Url:           https://google.com
Search:        google
Num matches:   1
Matches:
----------------------------------------
here
```

### 2.2 Search via regex

[](#22-search-via-regex)

Check if a website contains the the following regex `[0-9]+`

```
$ check_http_expect --url https://google.com --find '[0-9]+'
[OK] 4 matches found for: "[0-9]+".
Http version:  HTTP/1.1
Http code:     302
Http info:     Found
Server:        GFE/2.0
Url:           https://google.com
Search:        [0-9]+
Num matches:   4
Matches:
----------------------------------------
 302 Moved 302 Moved here.
```

### 2.3 .htaccess protection

[](#23-htaccess-protection)

Check behind a .htaccess protected website for the string `Your site is secured`

```
$ check_http_expect --url "http://www.example.com" --find 'Your site is secured' --huser john --hpass "Password"
[ERROR] No matches found for: "Your site is secured".
Http version:  HTTP/1.1
Http code:     302
Http info:     Found
Server:        Apache/2.4.16 (Amazon) PHP/5.5.30
Url:           http://www.example.com
Search:        Your site is secured
Num matches:   0
Matches:
----------------------------------------

```

### 2.4 POST Login

[](#24-post-login)

Login to at `http://www.example.com/login.php` with POST data `usernameFieldName=John`, `passwordFieldName=pass`, `submit=1`, go to `http://www.example.com` and check for the regex `[0-9]+`

```
$ check_http_expect --url "http://www.example.com" --find '[0-9]+' --lurl "http://www.example.com/login.php" --ldata  "usernameFieldName=John" --ldata "passwordFieldName=pass" --ldata "submit=1"
[ERROR] No matches found for: "[0-9]+".
Http version:  HTTP/1.1
Http code:     302
Http info:     Found
Server:        Apache/2.4.16 (Amazon) PHP/5.5.30
Url:           http://www.example.com
Search:        Your site is secured
Num matches:   0
Matches:

```

**Note:** htaccess and POST login can also be combined.

### 2.5 Set Cookies

[](#25-set-cookies)

Send a request with a custom cookie

```
$ check_http_expect --url https://google.com --find google --cookie "username=test"
[OK] 1 match found for: "google".
Http version:  HTTP/1.1
Http code:     302
Http info:     Found
Server:        GFE/2.0
Url:           https://google.com
Search:        google
Num matches:   1
Matches:
----------------------------------------
here
```

### 2.6 Multiple Search-Strings and different user-agent

[](#26-multiple-search-strings-and-different-user-agent)

When searching for multiple strings on the same page, its not necessary to do multiple requests. Just specify as many `find`-parameters as you need. You may want to change the user-agent with the parameter `ua` as well, in order to avoid undesired redirects.

```
$ check_hmg_http_expect --url "https://duckduckgo.com" --find "DuckDuckGo — Privacy, simplified." --find "Duck it\!" --find "NO-MATCH" --ua "curl/7.37.0"
[WARN] Not all matches found for: "DuckDuckGo — Privacy, simplified.
Duck it\!
NO-MATCH" | 'Results'=2 but expected: 3
Http version:  HTTP/2
Http code:     200
Http info:
Server:
Url:           https://duckduckgo.com
Search:        DuckDuckGo — Privacy, simplified.
               Duck it\!
               NO-MATCH

Num matches:   2
Matches:
----------------------------------------
        DuckDuckGo — Privacy, simplified.                                Duck it!
```

If only some of the specified search-strings are matched, then a warning is returned.

3. Specific Examples
--------------------

[](#3-specific-examples)

### 3.1 Log into wordpress.com

[](#31-log-into-wordpresscom)

Find String in Wordpress.com dashboard

```
$ check_http_expect --url "https://dashboard.wordpress.com/wp-admin/" --find "Recently Published" --lurl "https://wordpress.com/wp-login.php" --ldata "log=USER@EMAIL" --ldata "pwd=PASSWORD" --ldata "rememberme=forever" --ldata "testcookie=1"
[OK] 1 match found for: "Recently Published".
Http version:  HTTP/1.1
Http code:     200
Http info:     OK
Server:        nginx
Url:           https://dashboard.wordpress.com/wp-admin/
Search:        Recently Published
Num matches:   1
Matches:
----------------------------------------
Recently PublishedFeb 20th, 1:41 am TestJun 2nd, 6:10 pm Life would be so different if everyone jJun 1st, 10:08 pm for those of you who are still paying reJun 1st, 9:52 pm Having a great day so far and I hope allMay 26th, 10:37 pm In this video you will find out how to r
```

4. Awesome
----------

[](#4-awesome)

Added by the following [![Awesome](https://camo.githubusercontent.com/2727609d8bfde9ba1a95be1449eb878bfafa4d76789ba05661857e2c8ac70fa1/68747470733a2f2f63646e2e7261776769742e636f6d2f73696e647265736f726875732f617765736f6d652f643733303566333864323966656437386661383536353265336136336531353464643865383832392f6d656469612f62616467652e737667)](https://github.com/sindresorhus/awesome) lists:

- [awesome-nagios-plugins](https://github.com/cytopia/awesome-nagios-plugins)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~275 days

Total

5

Last Release

2797d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/527dbe351b75d33be6d5428502783ceb57e86949892a0a0062f24199772aabae?d=identicon)[cytopia](/maintainers/cytopia)

---

Top Contributors

[![cytopia](https://avatars.githubusercontent.com/u/12533999?v=4)](https://github.com/cytopia "cytopia (31 commits)")[![mathewmeconry](https://avatars.githubusercontent.com/u/4057473?v=4)](https://github.com/mathewmeconry "mathewmeconry (7 commits)")[![Iridias](https://avatars.githubusercontent.com/u/5657818?v=4)](https://github.com/Iridias "Iridias (2 commits)")[![TheLastProject](https://avatars.githubusercontent.com/u/1885159?v=4)](https://github.com/TheLastProject "TheLastProject (1 commits)")

---

Tags

httpnagiosicinganagios-pluginhttp POSThttp htaccess

### Embed Badge

![Health badge](/badges/cytopia-check-http-expect/health.svg)

```
[![Health](https://phpackages.com/badges/cytopia-check-http-expect/health.svg)](https://phpackages.com/packages/cytopia-check-http-expect)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.0k1.1B6.9k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k747.1M2.7k](/packages/psr-http-factory)[psr/http-client

Common interface for HTTP clients

1.7k731.6M2.9k](/packages/psr-http-client)[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.0k338.8M5.0k](/packages/symfony-http-client)[psr/link

Common interfaces for HTTP links

2.5k152.8M84](/packages/psr-link)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
