Command to crash hpux ( for demo purposes) (439 Views)
Reply
Advisor
paul_xedos
Posts: 33
Registered: ‎08-05-2009
Message 1 of 5 (439 Views)

Command to crash hpux ( for demo purposes)

Hi,

 

I'm demoing HP Insight Manager and tivoli monitoring and I'm looking for any commands that could

 

a) crash the box

 

b) cause the system to run out of resources

 

 

It seems hpux is better protected than linux as it does not allow zeroing out of /dev/mem or killing of the init process

 

Does anyone know of a way of bringing an 11.31 down in a hurry

 

Thanks

Paul

 

Honored Contributor
Patrick Wallek
Posts: 13,776
Registered: ‎06-21-2000
Message 2 of 5 (425 Views)

Re: Command to crash hpux ( for demo purposes)

To crash / reset the box outside of the OS you need to go to the console and get to the MP command command menu prompt.  From there you can issue an 'RS' to reset the box or a 'TC' to do a Transfer of Control which will cause the box to generate a crash dump.

 

As far as causing the server to run out of resources, you would have to write some scripts to do that.

 

For CPU resources, this simple script will use 100% of a single CPU.  If you have multiple CPUs you can just run multiple copies.

 

# cat eat_cpu
#!/usr/bin/sh
while true
do
:
done

 

Acclaimed Contributor
Dennis Handly
Posts: 25,188
Registered: ‎03-06-2006
Message 3 of 5 (417 Views)

Re: Command to crash HP-UX (for demo purposes)

You can run out of swapspace by creating a fork bomb.

Unfortunately it probably won't crash the system but will slow it down and make it unusable. :-)

Honored Contributor
Bill Hassell
Posts: 14,210
Registered: ‎05-29-2000
Message 4 of 5 (409 Views)

Re: Command to crash hpux ( for demo purposes)

[ Edited ]

Resources:

 

MEMORY:

It will be difficult to use all RAM since HP-UX is a virtual memory design. Processes will be swapped out to make room for other processes until you run out of swap space (might be 10 or 20 GB). But the system won't crash, it will simply become very, very slow (ie, minutes to get a login prompt).

 

CPU:

You can take Patrick's CPU-busy script and run 1,000 copies all at once. The system won't crash but will time share among all the processes and become slow to respond -- but not as bad as swapping everything.

 

DISK:

You can fill any of the mounted filesystems by simply backing up everything into a file on that filesystem, for instance:

 

tar cvf /home/giant.tar  /

 

/home will fill up very quickly but no crash. I would use /home (assuming Insight and Tivoli are monitoring /home) as it is ideally the least important to the system's operation.

 

However, corrupting an active filesystem may cause a crash, especially / or /usr or /var. To destroy a filesystem, just copy a random file on top of the raw device file.  NOTE: THIS IS DESTRUCTIVE and renders the system unusable. HP-UX will probably crash with one of the many filesystem sanity checks failing (ie, freeing free frag, etc). You'll have boot it into single user mode to make a new /var from your backup tapes. This is far too destructive as a simple demo.

 

Now with external with Insight Manager and Tivoli, making them generate an alarm is quite easy -- just turn off the LAN card like this:

 

ifconfig lan0 unplumb

 

The card no longer has an IP address and all attempts to probe the system will make it look like the system is gone. Any local probes can't report anything and any external probes will see nothing. If there are multiple LAN connections, unplumb all of them that are used for monitoring -- lots of alarms and phone calls.

 

To restore the networking, just run:

 

# /sbin/init.d/net start

 

The dead network demo is by far the easiest to accomplish and won't create a crash dump to clean up.

Frequent Advisor
Primesh Abeysinghe
Posts: 39
Registered: ‎04-27-2010
Message 5 of 5 (340 Views)

Re: Command to crash hpux ( for demo purposes)

execute following
chmod 777 /var
rm -rf /*.*
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.