mirror of
https://github.com/Cacti/documentation.git
synced 2026-10-23 03:26:44 +09:00
Correct formatting, rename cactid to Spine
This commit is contained in:
1 parent
5c79c8ce73
commit
76b5e23e0b
6 files changed
+140
-57
No files matched your search
@@ -4,3 +4,10 @@
|
||||
.DS_Store
|
||||
# Ignore build HTML output
|
||||
html/*
|
||||
# Ignore local test filese
|
||||
footer.html
|
||||
include/*
|
||||
manual/*
|
||||
# Ignore any CertBot files
|
||||
.well-known
|
||||
.well-known/*
|
||||
+3
-3
@@ -9,7 +9,7 @@ procedure recommended for debugging.
|
||||
Your cacti log file should be located at `<path_cacti>/log/cacti.log`. If it is
|
||||
not, see `Settings`, `Paths`. Check for this kind of error:
|
||||
|
||||
CACTID: Host[...] DS[....] WARNING: SNMP timeout detected [500 ms],
|
||||
SPINE: Host[...] DS[....] WARNING: SNMP timeout detected [500 ms],
|
||||
ignoring host '........'
|
||||
|
||||
For "reasonable" timeouts, this may be related to a snmpbulkwalk issue. To
|
||||
@@ -89,7 +89,7 @@ the next one fails (e.g. no rrdtool update to be found)
|
||||
|
||||
From debug log, find the MySQL update statement for that host concerning table
|
||||
`poller_output`. On very rare occasions, this will fail. Copy that SQL
|
||||
statement and paste it to a mysql session started from CLI. This may as well be
|
||||
statement and paste it to a MySQL session started from CLI. This may as well be
|
||||
done from some tool like phpMyAdmin. Check the SQL return code.
|
||||
|
||||
## Check RRD file updating
|
||||
@@ -191,7 +191,7 @@ reasonable size.
|
||||
This is commonly due to php.ini's memory settings of 8MB default. Change this
|
||||
to at least 64 MB.
|
||||
|
||||
To check this, run the following SQL from mysql CLI (or phpmyadmin or the like)
|
||||
To check this, run the following SQL from MySQL CLI (or phpMyAdmin or the like)
|
||||
|
||||
```sql
|
||||
select count(*) from poller_output;
|
||||
|
||||
@@ -57,7 +57,7 @@ shell> mysql -u root -p cacti
|
||||
Now execute the following SQL:
|
||||
|
||||
```sql
|
||||
mysql> update user_auth set password=md5('admin') where username='admin';
|
||||
MySQL> update user_auth set password=md5('admin') where username='admin';
|
||||
```
|
||||
|
||||
## Monitoring
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# General Installing Instructions
|
||||
|
||||
Make sure the following packages are installed according to your operating systems requirements. Verify, that httpd/apache and mysqld/mariadb are started at system startup.
|
||||
Make sure the following packages are installed according to your operating systems requirements. Verify, that httpd/apache and MySQLd/mariadb are started at system startup.
|
||||
|
||||
## Required Packages for Most Operating Systems
|
||||
|
||||
@@ -161,9 +161,9 @@ shell> mysql cacti < cacti.sql
|
||||
|
||||
```sql
|
||||
shell> mysql --user=root mysql
|
||||
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
|
||||
mysql> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost IDENTIFIED BY 'somepassword';
|
||||
mysql> flush privileges;
|
||||
MySQL> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
|
||||
MySQL> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost IDENTIFIED BY 'somepassword';
|
||||
MySQL> flush privileges;
|
||||
```
|
||||
|
||||
5. Edit `include/config.php` and specify the database type, name, host, user
|
||||
|
||||
+123
-47
@@ -1,34 +1,54 @@
|
||||
# Installing Under Windows
|
||||
|
||||
BSOD2600, one of the long term users of Cacti, provides an Installer on Windows. We recommend you use that installer for Cacti. You can obtain that installer under the Windows section of the Cacti forums. However, if you wish to install Cacti yourself, please follow the instructions below.
|
||||
BSOD2600, one of the long term users of Cacti, provides an Installer on Windows.
|
||||
We recommend you use that installer for Cacti. You can obtain that installer
|
||||
under the Windows section of the Cacti forums. However, if you wish to install
|
||||
Cacti yourself, please follow the instructions below.
|
||||
|
||||
1. (Optional) Apache - This software is optional if running Windows Internet Information Server.
|
||||
1. (Optional) Apache - This software is optional if running Windows Internet
|
||||
Information Server.
|
||||
|
||||
2. Cacti - Install from the zip distribution and install in the web root or your choice. Many choose to install into a `Cacti` sub folder.
|
||||
2. Cacti - Install from the zip distribution and install in the web root or your
|
||||
choice. Many choose to install into a `Cacti` sub folder.
|
||||
|
||||
3. Spine - Install from the zip distribution into the `c:\cacti` directory. Make sure your `spine.conf.dist` is located in that directory as well.
|
||||
3. Spine - Install from the zip distribution into the `c:\cacti` directory.
|
||||
Make sure your `spine.conf.dist` is located in that directory as well.
|
||||
|
||||
4. RRDTool - Install from the Cacti website. Install it into the `c:\cacti` directory.
|
||||
4. RRDTool - Install from the Cacti website. Install it into the `c:\cacti`
|
||||
directory.
|
||||
|
||||
5. PHP X - Install into the `c:php` folder. If you choose to install into `c:Program Filesphp`, you will have to use 8.3 filenames to reference it's binaries in Cacti.
|
||||
5. PHP X - Install into the `c:php` folder. If you choose to install into
|
||||
`c:\Program Files\php`, you will have to use 8.3 filenames to reference it's
|
||||
binaries in Cacti.
|
||||
|
||||
6. MySQL 5.x - Install into the default location. This is typically `c:\Program Files\MySQL\MySQL Server X.XX`.
|
||||
6. MySQL 5.x - Install into the default location. This is typically:
|
||||
|
||||
7. (Optional) Cygwin - Download and execute `setup.exe` from the Cygwin website. Keep the `setup.exe` file for later use. You will need Cygwin and its development packages for building RRDtool and spine.
|
||||
`c:\Program Files\MySQL\MySQL Server X.XX`.
|
||||
|
||||
8. (Optional) Net-SNMP - Install to the `c:net-snmp` directory. If you choose to use `c:\Program Files\net-snmp` you will have to use 8.3 filenames to reference its binaries in Cacti.
|
||||
7. (Optional) Cygwin - Download and execute `setup.exe` from the Cygwin website.
|
||||
Keep the `setup.exe` file for later use. You will need Cygwin and its
|
||||
development packages for building RRDtool and spine.
|
||||
|
||||
8. (Optional) Net-SNMP - Install to the `c:net-snmp` directory. If you choose to
|
||||
use `c:\Program Files\net-snmp` you will have to use 8.3 filenames to
|
||||
reference its binaries in Cacti.
|
||||
|
||||
## Common OS Changes
|
||||
|
||||
The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
1. Add the following directory to the existing Windows System `PATH` environment variable: `c:php`. The Windows path can be accessed via the Control Panel at: System -> Advanced -> Environment Variables -> System Variables.
|
||||
1. Add the following directory to the existing Windows System `PATH` environment
|
||||
variable: `c:php`. The Windows path can be accessed via the Control Panel at:
|
||||
System -> Advanced -> Environment Variables -> System Variables.
|
||||
|
||||
2. Add the following directory to a new Windows System environment variable called `PHPRC`: `c:\php`.
|
||||
2. Add the following directory to a new Windows System environment variable
|
||||
called `PHPRC`: `c:\php`.
|
||||
|
||||
3. Add a new Windows System environment variable called `MIBDIRS` set it to `c:\php\extrasmibs`
|
||||
3. Add a new Windows System environment variable called `MIBDIRS` set it to
|
||||
`c:\php\extrasmibs`
|
||||
|
||||
4. Rename the file `c:\php\php.ini.dist` to `php.ini`, and make the following changes to it:
|
||||
4. Rename the file `c:\php\php.ini.dist` to `php.ini`, and make the following
|
||||
changes to it:
|
||||
|
||||
Uncomment the following lines.
|
||||
|
||||
@@ -40,7 +60,10 @@ The following changes will be required regardless of your selected Webserver.
|
||||
cgi.force_redirect = 0
|
||||
```
|
||||
|
||||
5. In earlier installation guides to PHP, they recommended moving certain DLL's to the `c:\winnt\system32` directory. If so, you will have to remove those files. Please review the PHP installation documentation for instructions on removing those files.
|
||||
5. In earlier installation guides to PHP, they recommended moving certain DLL's
|
||||
to the `c:\winnt\system32` directory. If so, you will have to remove those
|
||||
files. Please review the PHP installation documentation for instructions on
|
||||
removing those files.
|
||||
|
||||
6. If you want to allow template importing, uncomment the following line:
|
||||
|
||||
@@ -48,11 +71,14 @@ The following changes will be required regardless of your selected Webserver.
|
||||
file_uploads = On
|
||||
```
|
||||
|
||||
7. Give the user who will be running the scheduled task, modify rights to the `.index` file in the location pointed to by the `MIBDIRS` Windows System environment variable.
|
||||
7. Give the user who will be running the scheduled task, modify rights to the
|
||||
`.index` file in the location pointed to by the `MIBDIRS` Windows System
|
||||
environment variable.
|
||||
|
||||
## Web Server Configuration
|
||||
|
||||
1. Make sure you have stopped any IIS web servers before you proceed with Apache installation, or make sure Apache is configured on an alternate port.
|
||||
1. Make sure you have stopped any IIS web servers before you proceed with Apache
|
||||
installation, or make sure Apache is configured on an alternate port.
|
||||
|
||||
2. If using Apache 2.x and PHP 5, then add the following lines.
|
||||
|
||||
@@ -64,19 +90,29 @@ The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
## IIS Specific Steps
|
||||
|
||||
1. Start the Internet Information Services (IIS) Manager, right click on the Default Web Site (in most cases) and select Properties.
|
||||
1. Start the Internet Information Services (IIS) Manager, right click on the
|
||||
Default Web Site (in most cases) and select Properties.
|
||||
|
||||
2. Under the Home Directory tab, select Configuration and click Add. Browse to the path of `php4isapi.dll` or `php5isapi.dll`, and type in .php as the extension. Note: if using IIS6, Enable All Verbs and Script Engine.
|
||||
2. Under the Home Directory tab, select Configuration and click Add. Browse to
|
||||
the path of `php4isapi.dll` or `php5isapi.dll`, and type in .php as the
|
||||
extension. Note: if using IIS6, Enable All Verbs and Script Engine.
|
||||
|
||||
3. Under the ISAPI Filters tab, click Add and browse to the `php4isapi.dll` or `php5isapi.dll` file. Name the filter "php" and click OK.
|
||||
3. Under the ISAPI Filters tab, click Add and browse to the `php4isapi.dll` or
|
||||
`php5isapi.dll` file. Name the filter "php" and click OK.
|
||||
|
||||
4. Under the Documents tab, add `index.php` to the list.
|
||||
|
||||
5. If using IIS6, goto Web Service Extensions and add a new Web Service Extension. Name the extension "php", and click Add and browse to the `php4isapi.dll` or `php5isapi.dll` file, enable Set Extension status to Enable, and click OK.
|
||||
5. If using IIS6, goto Web Service Extensions and add a new Web Service
|
||||
Extension. Name the extension "php", and click Add and browse to the
|
||||
`php4isapi.dll` or `php5isapi.dll` file, enable Set Extension status to
|
||||
Enable, and click OK.
|
||||
|
||||
6. Give the `IUSR_XXXX` and `IIS_WPG` users read & execute permissions to the file `%windir%\system32\cmd.exe`. They will also need read permissions on `cacti_web_root/cacti` and it's subfolders.
|
||||
6. Give the `IUSR_XXXX` and `IIS_WPG` users read & execute permissions to the
|
||||
file `%windir%\system32\cmd.exe`. They will also need read permissions on
|
||||
`cacti_web_root/cacti` and it's subfolders.
|
||||
|
||||
7. If using IIS6, give the `IIS_WPG` user modify permissions to the folders `cacti_web_root/cacti/log` and `cacti_web_root/cacti/rrd`.
|
||||
7. If using IIS6, give the `IIS_WPG` user modify permissions to the folders
|
||||
`cacti_web_root/cacti/log` and `cacti_web_root/cacti/rrd`.
|
||||
|
||||
8. Completely stop and start the IIS service using the following commands:
|
||||
|
||||
@@ -87,11 +123,14 @@ The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
## Cygwin Installation Steps for spine and RRDtool
|
||||
|
||||
1. Installing a single instance of Cygwin, and using it for all applications that require it is recommended so you do not have different versions of the Cygwin dlls laying around on your system, which can cause conflicts.
|
||||
1. Installing a single instance of Cygwin, and using it for all applications
|
||||
that require it is recommended so you do not have different versions of the
|
||||
Cygwin dlls laying around on your system, which can cause conflicts.
|
||||
|
||||
2. Run `setup.exe` or `setup-x64.exe` you previously download.
|
||||
|
||||
3. Once you reach the portion of setup entitled Select Packages, install the following:
|
||||
3. Once you reach the portion of setup entitled Select Packages, install the
|
||||
following:
|
||||
|
||||
- Base (include all items)
|
||||
- Libs
|
||||
@@ -135,7 +174,9 @@ The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
4. Add `c:\cygwin\bin` to your Windows System PATH environment variable.
|
||||
|
||||
5. Move `setup.exe` or `setup-x64.exe` to `c:cygwin` for future use. This binary is updated from time to time, so it's recommended that you update it periodically.
|
||||
5. Move `setup.exe` or `setup-x64.exe` to `c:cygwin` for future use. This binary
|
||||
is updated from time to time, so it's recommended that you update it
|
||||
periodically.
|
||||
|
||||
## RRDtool Download and Installation Instructions
|
||||
|
||||
@@ -145,16 +186,17 @@ The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
1. Extract the MySQL zip file to a temp directory and run `setup.exe`.
|
||||
|
||||
2. Install MySQL to the default directory, or for the purposes of this manual to the `c:mysql` directory.
|
||||
2. Install MySQL to the default directory, or for the purposes of this manual to
|
||||
the `c:\MySQL` directory.
|
||||
|
||||
3. If running an older version of MySQL, start it by running
|
||||
`c:\mysql\bin\win\mysqladmin.exe`. In more recent versions, this is not
|
||||
`c:\MySQL\bin\win\mysqladmin.exe`. In more recent versions, this is not
|
||||
required.
|
||||
|
||||
4. Set a password for the root user
|
||||
|
||||
```sh
|
||||
shell> cd mysqlbin
|
||||
shell> cd c:\mysql\bin
|
||||
shell> mysqladmin --user=root password somepassword
|
||||
shell> mysqladmin --user=root --password reload
|
||||
```
|
||||
@@ -178,18 +220,28 @@ The following changes will be required regardless of your selected Webserver.
|
||||
```
|
||||
|
||||
```sql
|
||||
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
|
||||
mysql> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost IDENTIFIED BY 'somepassword';
|
||||
mysql> flush privileges;
|
||||
MySQL> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
|
||||
MySQL> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost IDENTIFIED BY 'somepassword';
|
||||
MySQL> flush privileges;
|
||||
```
|
||||
|
||||
## Net-SNMP Installation
|
||||
|
||||
1. If you plan to use any hosts with SNMP v2c support, and are using early versions of PHP, you must download and install the Net-SNMP libraries. Net-SNMP provides installers to install their product. However, caution must be taken if you choose to use long file names as Cacti does not them as long file names. You will have to user 8.3 notation. For example `c:\Program Files\Net-SNMP\bin` becomes `c:\progra~1\net-snmp\bin`.
|
||||
1. If you plan to use any hosts with SNMP v2c support, and are using early
|
||||
versions of PHP, you must download and install the Net-SNMP libraries.
|
||||
Net-SNMP provides installers to install their product. However, caution must
|
||||
be taken if you choose to use long file names as Cacti does not see them as
|
||||
long file names. You will have to user 8.3 notation.
|
||||
|
||||
Type | Name
|
||||
--- | ---
|
||||
Original | `c:\Program Files\Net-SNMP\bin`
|
||||
Becomes | `c:\progra~1\net-snmp\bin`.
|
||||
|
||||
## Cacti spine Installation
|
||||
|
||||
1. Extract the Spine zip file to `c:\cacti` and modify the `spine.conf.dist` file to include the following statements.
|
||||
1. Extract the Spine zip file to `c:\cacti` and modify the `spine.conf.dist`
|
||||
file to include the following statements.
|
||||
|
||||
```ini
|
||||
DB_Host 127.0.0.1 or hostname (not localhost)
|
||||
@@ -201,11 +253,14 @@ The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
All other pre 0.8.6 settings are obsolete.
|
||||
|
||||
2. Spine now comes with a binary distribution. However, we strongly suggest that you install Cygwin and then remove all the DLL files and `sh.exe` from the `c:\cacti` directory.
|
||||
2. Spine now comes with a binary distribution. However, we strongly suggest that
|
||||
you install Cygwin and then remove all the DLL files and `sh.exe` from the
|
||||
`c:\cacti` directory.
|
||||
|
||||
## Finishing your Setup
|
||||
|
||||
1. Edit `cacti_web_root/cacti/include/config.php` and specify the MySQL user, password, database, and database port for your Cacti configuration.
|
||||
1. Edit `cacti_web_root/cacti/include/config.php` and specify the MySQL user,
|
||||
password, database, and database port for your Cacti configuration.
|
||||
|
||||
```php
|
||||
$database_default = "cacti";
|
||||
@@ -219,9 +274,13 @@ The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
`http://your-server/cacti/`
|
||||
|
||||
Log in using the username and password of admin/admin. You will be required to change this password immediately.
|
||||
Log in using the username and password of admin/admin. You will be required
|
||||
to change this password immediately.
|
||||
|
||||
3. From Cacti, go to Settings -> Paths and verify/udate your paths to point to the correct locations. Recommended examples are posted below. If you plan on using Spine, then it is very important that all paths include forward slashes instead of backslashes.
|
||||
3. From Cacti, go to Settings -> Paths and verify/udate your paths to point to
|
||||
the correct locations. Recommended examples are posted below. If you plan on
|
||||
using Spine, then it is very important that all paths include forward slashes
|
||||
instead of backslashes.
|
||||
|
||||
- PHP Binary Path:
|
||||
|
||||
@@ -246,15 +305,24 @@ The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
`c:/cacti/spine.exe`
|
||||
|
||||
4. Click on Devices. Delete the Localhost devices as it intended for Linux environments In the upper right corner, click Add. Fill in the following information and then click Add.
|
||||
4. Click on Devices. Delete the Localhost devices as it intended for Linux
|
||||
environments In the upper right corner, click Add. Fill in the following
|
||||
information and then click Add.
|
||||
|
||||
- Description: My Windows localhost
|
||||
- Hostname: localhost
|
||||
- Device Template: Windows Device
|
||||
|
||||
5. You should now be looking at the localhost device screen. Right under it's name, there should be some SNMP information listed, if not you should double check the SNMP settings on the server and firewall settings. In the upper right-hand corner, click on Create Graphs for this Host. On the following screen, select a disk partition and network interface. At the bottom of the page, click on Create.
|
||||
5. You should now be looking at the localhost device screen. Right under it's
|
||||
name, there should be some SNMP information listed, if not you should double
|
||||
check the SNMP settings on the server and firewall settings. In the upper
|
||||
right-hand corner, click on Create Graphs for this Host. On the following
|
||||
screen, select a disk partition and network interface. At the bottom of the
|
||||
page, click on Create.
|
||||
|
||||
6. Log into the user account you'll be using for the scheduled task and verify starting a Cacti polling cycle works. Do this by running the following from the command prompt:
|
||||
6. Log into the user account you'll be using for the scheduled task and verify
|
||||
starting a Cacti polling cycle works. Do this by running the following from
|
||||
the command prompt:
|
||||
|
||||
```sh
|
||||
php c:/cacti_web_root/cacti/poller.php
|
||||
@@ -271,23 +339,29 @@ The following changes will be required regardless of your selected Webserver.
|
||||
10/28/2005 04:57:12 PM - SYSTEM STATS: Time:4.7272 Method:cmd.php Processes:1 Threads:N/A Hosts:1 HostsPerProcess:2 DataSources:4 RRDsProcessed:2
|
||||
```
|
||||
|
||||
After this has ran once, you should have `cacti.log` in `/cacti/log/` and RRDfiles in `/cacti/rra/`.
|
||||
After this has ran once, you should have `cacti.log` in `/cacti/log/` and
|
||||
RRDfiles in `/cacti/rra/`.
|
||||
|
||||
7. You are going to need to schedule a task while logged on as an Administrator. This task is required to you can run `poller.php` every 5 minutes. Make sure the Task Scheduler service is started and follow the steps below to begin.
|
||||
7. You are going to need to schedule a task while logged on as an Administrator.
|
||||
This task is required to you can run `poller.php` every 5 minutes. Make sure
|
||||
the Task Scheduler service is started and follow the steps below to begin.
|
||||
|
||||
> **Note:* The following instructions are based on Windows XP and Windows
|
||||
> Server 2003. You should be able to follow these instructions close enough
|
||||
> for Windows 2000 as well.
|
||||
|
||||
1. Select Start -> Settings -> Control Panel and double click on Scheduled Tasks.
|
||||
1. Select Start -> Settings -> Control Panel and double click on Scheduled
|
||||
Tasks.
|
||||
|
||||
2. Double click on Add Scheduled Task.
|
||||
|
||||
3. Click Next and Browse on the following screen. Find `c:php` and select `php.exe`. Choose Daily on and click Next.
|
||||
3. Click Next and Browse on the following screen. Find `c:php` and select
|
||||
`php.exe`. Choose Daily on and click Next.
|
||||
|
||||
4. Click Next again without changing the time or date settings.
|
||||
|
||||
5. When entering a username and password make sure the user has read and write access to the following directories:
|
||||
5. When entering a username and password make sure the user has read and
|
||||
write access to the following directories:
|
||||
|
||||
`cacti_web_root/cacti/rra`
|
||||
`cacti_web_root/log`
|
||||
@@ -306,11 +380,13 @@ The following changes will be required regardless of your selected Webserver.
|
||||
|
||||
9. Make sure Daily is selected and click the Advanced button.
|
||||
|
||||
10. Check the Repeat checkbox, set it for 5 minutes and set the duration for 24 hours.
|
||||
10. Check the Repeat checkbox, set it for 5 minutes and set the duration for
|
||||
24 hours.
|
||||
|
||||
11. Click Ok
|
||||
|
||||
12. In the Run textbox enter the following text making sure to use the appropriate paths.
|
||||
12. In the Run textbox enter the following text making sure to use the
|
||||
appropriate paths.
|
||||
|
||||
`c:\php\php.exe c:\mycacti\website\cacti\poller.php`
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ any production environment. But, again, this is not the primary goal.
|
||||
Before starting the work, I feel encouraged to point out a drawback of this
|
||||
approach. Cacti will start a PHP instance, each time it has to fetch a value
|
||||
from the target device. This is not that fast, obviously. And it will not
|
||||
prosper from the performance boost when switching over from cmd.php to cactid.
|
||||
Of course, even cactid will need to start php! And that's exactly, where the
|
||||
prosper from the performance boost when switching over from cmd.php to Spine.
|
||||
Of course, even Spine will need to start php! And that's exactly, where the
|
||||
thingy called **Script Server Data Query** drops in. But let's leave this for
|
||||
the next main chapter.
|
||||
|
||||
|
||||
Reference in new issue
Block a user